Skip to content

Commit

Permalink
Fix ‘-e’ switch when ‘%E’ escape in ‘tab-arguments’ option is present
Browse files Browse the repository at this point in the history
Perl interprets ‘$#$root->{argv}’ as ‘($#$root)->{argv}’ which causes
and error since ‘$root’ is not an array reference:

    urxvt: Not an ARRAY reference at /home/wd/.urxvt/ext/tabbedex line 806.

This would trigger whenever ‘-e’ switch and ‘%E’ escape in
‘tab-arguments’ option were used together.  Fix by adding braces to
change binding of the operators.

Fixes: #33
  • Loading branch information
mina86 committed Feb 26, 2020
1 parent a65e1cc commit d907f29
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion tabbedex
Original file line number Diff line number Diff line change
Expand Up @@ -801,7 +801,7 @@ sub args_percent_substitution {
quote_words @{ $root->{argv} }
} elsif ($ch eq 'E') {
quote_words @{ $root->{argv} }
? @{ $root->{argv} }[1..$#$root->{argv}]
? @{ $root->{argv} }[1..$#{ $root->{argv} }]
: ($ENV{SHELL} || '/bin/sh')
} elsif ($ch eq 'p') {
$tab ? $tab->foreground_pgid : -1
Expand Down

0 comments on commit d907f29

Please sign in to comment.