Skip to content

Commit

Permalink
Fix crash on :toggle file-args
Browse files Browse the repository at this point in the history
Reported-by: Johannes Altmanninger <[email protected]>
  • Loading branch information
koutcher committed Jan 9, 2022
1 parent d742132 commit 8b12fa9
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
1 change: 1 addition & 0 deletions NEWS.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ Bug fixes:
- Fix navigation between chunks after splitting chunk. (#1101, #1162)
- Fix status line when toggling general options. (#1163, #1164)
- Honor reference-format = hide:tag in diff view. (#1168, #1170)
- Fix crash on :toggle file-args.

tig-2.5.4
---------
Expand Down
6 changes: 4 additions & 2 deletions src/prompt.c
Original file line number Diff line number Diff line change
Expand Up @@ -798,8 +798,10 @@ prompt_toggle_option(struct view *view, const char *argv[], const char *prefix,
int i;

if (argv_size(argv) <= 2) {
argv_free(*opt);
(*opt)[0] = NULL;
if (*opt) {
argv_free(*opt);
(*opt)[0] = NULL;
}
return SUCCESS;
}

Expand Down

0 comments on commit 8b12fa9

Please sign in to comment.