Skip to content

Commit 6ebedab

Browse files
committed
gitk: Fix bug introduced by previous commit
When I added the "--" case to the code scanning the arguments, I missed the fact that since the switch statement uses -regexp, the "--" case will match any argument containing "--", e.g. "--all". This fixes it by taking out the -regexp (since we don't actually need regular expression matching) and adjusting the match strings. A side effect of this is that previously any argument starting with "-d" would be taken to indicate date mode; now the argument has to be exactly "-d" if you want date mode. Signed-off-by: Paul Mackerras <paulus@samba.org>
1 parent cdaee5d commit 6ebedab

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

gitk

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7478,9 +7478,9 @@ set revtreeargs {}
74787478
set cmdline_files {}
74797479
set i 0
74807480
foreach arg $argv {
7481-
switch -regexp -- $arg {
7482-
"^$" { }
7483-
"^-d" { set datemode 1 }
7481+
switch -- $arg {
7482+
"" { }
7483+
"-d" { set datemode 1 }
74847484
"--" {
74857485
set cmdline_files [lrange $argv [expr {$i + 1}] end]
74867486
break

0 commit comments

Comments
 (0)