diff options
-rw-r--r-- | ChangeLog | 22 | ||||
-rw-r--r-- | Completion/Linux/Command/_btrfs | 2 | ||||
-rw-r--r-- | Src/exec.c | 13 | ||||
-rw-r--r-- | Src/hist.c | 6 | ||||
-rw-r--r-- | Test/E02xtrace.ztst | 9 |
5 files changed, 51 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog index a8dc3b9e0..524f54242 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,25 @@ +2013-10-10 Peter Stephenson <p.stephenson@samsung.com> + + * 31810: Test/E02xtrace.ztst: tests for simple cases of XTRACE + output for conditions. + + * 31809: Src/exec.c: make whitespace clear in trace output for + patterns. + +2013-10-08 Peter Stephenson <p.w.stephenson@ntlworld.com> + + * Eric Cook: 31801: Completion/Linux/Command/_btrfs: some + additional variables need to be local. + +2013-10-08 Barton E. Schaefer <schaefer@zsh.org> + + * 31797: partly fix long-standing history expansion bug in which + in some circumstances a default history expansion would occur even + when there is neither an event nor a word designator, which is + contradictory to the documentation. There are still some cases in + which expansion is attempted when it should not be, but in most of + those cases the expansion simply fails. + 2013-10-07 Peter Stephenson <p.stephenson@samsung.com> * 31794: Src/hist.c: further refinement that SHAREHISTORY should diff --git a/Completion/Linux/Command/_btrfs b/Completion/Linux/Command/_btrfs index eac827050..da2514e99 100644 --- a/Completion/Linux/Command/_btrfs +++ b/Completion/Linux/Command/_btrfs @@ -1,7 +1,7 @@ #compdef btrfs local curcontext="$curcontext" curstate state line expl grp cmd ret=1 -local -a groups args +local -a groups args cmds_1 cmds_2 cmds_3 cmds_4 cmds_5 cmds_6 groups=( subvolume filesystem device scrub balance inspect-internal help version ) cmds_1=( create delete list snapshot get-default set-default find-new help ) diff --git a/Src/exec.c b/Src/exec.c index 1c44565f9..de1b4848e 100644 --- a/Src/exec.c +++ b/Src/exec.c @@ -1845,9 +1845,22 @@ quote_tokenized_output(char *str, FILE *file) case '*': case '?': case '$': + case ' ': putc('\\', file); break; + case '\t': + fputs("$'\\t'", file); + continue; + + case '\n': + fputs("$'\\n'", file); + continue; + + case '\r': + fputs("$'\\r'", file); + continue; + case '=': if (s == str) putc('\\', file); diff --git a/Src/hist.c b/Src/hist.c index d1af30a29..bd650e81e 100644 --- a/Src/hist.c +++ b/Src/hist.c @@ -521,6 +521,12 @@ histsubchar(int c) } c = ingetc(); } + if (ptr == buf && + (c == '}' || c == ';' || c == '\'' || c == '"' || c == '`')) { + /* Neither event nor word designator, no expansion */ + safeinungetc(c); + return bangchar; + } *ptr = 0; if (!*buf) { if (c != '%') { diff --git a/Test/E02xtrace.ztst b/Test/E02xtrace.ztst index 2420aebd7..093a587bd 100644 --- a/Test/E02xtrace.ztst +++ b/Test/E02xtrace.ztst @@ -118,3 +118,12 @@ ?+./fnfile:5> : ?+./fnfile:6> fn ?+./fnfile:3> print This is fn. + + set -x + [[ 'f o' = 'f x'* || 'b r' != 'z o' && 'squashy sound' < 'squishy sound' ]] + [[ -e nonexistentfile || ( -z '' && -t 3 ) ]] + set +x +0:Trace for conditions +?+(eval):2> [[ 'f o' == f\ x* || 'b r' != z\ o && 'squashy sound' < 'squishy sound' ]] +?+(eval):3> [[ -e nonexistentfile || -z '' && -t 3 ]] +?+(eval):4> set +x |