mirror of
git://git.code.sf.net/p/zsh/code
synced 2026-01-06 09:41:07 +01:00
users/21352: ensure $'' doesn't get elided.
Assign nulstring to it if empty. Test for all forms of quotation marks.
This commit is contained in:
parent
17fb014dc7
commit
dc2397f754
3 changed files with 12 additions and 1 deletions
|
|
@ -1,5 +1,8 @@
|
|||
2016-03-07 Peter Stephenson <p.stephenson@samsung.com>
|
||||
|
||||
* users/21352: Src/subst.c, Test/A03quoting.ztst: use nulstring
|
||||
to ensure $'' isn't elided.
|
||||
|
||||
* 38094: Src/signals.c, Test/C03traps.ztst: POSIX exit traps
|
||||
aren't local so local level should be 0 so they don't
|
||||
get trashed if defined in a function.
|
||||
|
|
|
|||
|
|
@ -145,8 +145,12 @@ stringsubstquote(char *strstart, char **pstrdpos)
|
|||
strret = dyncat(strstart, strsub);
|
||||
} else if (strdpos[len])
|
||||
strret = dyncat(strsub, strdpos + len);
|
||||
else
|
||||
else if (*strsub)
|
||||
strret = strsub;
|
||||
else {
|
||||
/* This ensures a $'' doesn't get elided. */
|
||||
strret = dupstring(nulstring);
|
||||
}
|
||||
|
||||
*pstrdpos = strret + (strdpos - strstart) + strlen(strsub);
|
||||
|
||||
|
|
|
|||
|
|
@ -74,3 +74,7 @@
|
|||
>16#61
|
||||
>16#62
|
||||
>16#64
|
||||
|
||||
() { print $# } '' "" $''
|
||||
0:$'' should not be elided, in common with other empty quotes
|
||||
>3
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue