Skip to content

Commit 8b12fa9

Browse files
committed
Fix crash on :toggle file-args
Reported-by: Johannes Altmanninger <[email protected]>
1 parent d742132 commit 8b12fa9

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

NEWS.adoc

+1
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ Bug fixes:
3535
- Fix navigation between chunks after splitting chunk. (#1101, #1162)
3636
- Fix status line when toggling general options. (#1163, #1164)
3737
- Honor reference-format = hide:tag in diff view. (#1168, #1170)
38+
- Fix crash on :toggle file-args.
3839

3940
tig-2.5.4
4041
---------

src/prompt.c

+4-2
Original file line numberDiff line numberDiff line change
@@ -798,8 +798,10 @@ prompt_toggle_option(struct view *view, const char *argv[], const char *prefix,
798798
int i;
799799

800800
if (argv_size(argv) <= 2) {
801-
argv_free(*opt);
802-
(*opt)[0] = NULL;
801+
if (*opt) {
802+
argv_free(*opt);
803+
(*opt)[0] = NULL;
804+
}
803805
return SUCCESS;
804806
}
805807

0 commit comments

Comments
 (0)