diff options
author | Peter Stephenson <pws@zsh.org> | 2016-03-07 09:44:54 +0000 |
---|---|---|
committer | Peter Stephenson <pws@zsh.org> | 2016-03-07 09:44:54 +0000 |
commit | dc2397f7548632910267f31bc1c97d45602453c0 (patch) | |
tree | 6300eaa8112875aefb4570d169daa9b62d5c4e28 /Src | |
parent | 17fb014dc7984902a6697c6412b0cca55300542b (diff) | |
download | zsh-dc2397f7548632910267f31bc1c97d45602453c0.tar.gz zsh-dc2397f7548632910267f31bc1c97d45602453c0.tar.xz zsh-dc2397f7548632910267f31bc1c97d45602453c0.zip |
users/21352: ensure $'' doesn't get elided.
Assign nulstring to it if empty. Test for all forms of quotation marks.
Diffstat (limited to 'Src')
-rw-r--r-- | Src/subst.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/Src/subst.c b/Src/subst.c index bb1dd8939..f2d0f6553 100644 --- a/Src/subst.c +++ b/Src/subst.c @@ -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); |