diff options
| author | Martijn Dekker <martijn@inlv.org> | 2017-08-03 19:57:04 +0200 |
|---|---|---|
| committer | Peter Stephenson <p.w.stephenson@ntlworld.com> | 2017-08-03 21:32:20 +0100 |
| commit | a51cd62b4567e5c18b4a2b7c98bb3087013afdc3 (patch) | |
| tree | 13c7e82fcc1d2ed1dc41bdc4bf5a8206d53e1135 /Src/utils.c | |
| parent | 41479: _xz: Complete compressed, rather than uncompressed, files after -d. (diff) | |
| download | zsh-a51cd62b4567e5c18b4a2b7c98bb3087013afdc3.tar zsh-a51cd62b4567e5c18b4a2b7c98bb3087013afdc3.tar.gz zsh-a51cd62b4567e5c18b4a2b7c98bb3087013afdc3.tar.bz2 zsh-a51cd62b4567e5c18b4a2b7c98bb3087013afdc3.tar.lz zsh-a51cd62b4567e5c18b4a2b7c98bb3087013afdc3.tar.xz zsh-a51cd62b4567e5c18b4a2b7c98bb3087013afdc3.tar.zst zsh-a51cd62b4567e5c18b4a2b7c98bb3087013afdc3.zip | |
41484: Make ${(q+)...} quote backsleshes.
Diffstat (limited to 'Src/utils.c')
| -rw-r--r-- | Src/utils.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/Src/utils.c b/Src/utils.c index 1b80e8cb0..5055d69fe 100644 --- a/Src/utils.c +++ b/Src/utils.c @@ -5119,7 +5119,7 @@ niceztrlen(char const *s) * If flags contains NICEFLAG_HEAP, use the heap for *outstrp, else * zalloc. * If flags contsins NICEFLAG_QUOTE, the output is going to be within - * $'...', so quote "'" with a backslash. + * $'...', so quote "'" and "\" with a backslash. */ /**/ @@ -5175,6 +5175,10 @@ mb_niceformat(const char *s, FILE *stream, char **outstrp, int flags) fmt = "\\'"; newl = 2; } + else if (c == L'\\' && (flags & NICEFLAG_QUOTE)) { + fmt = "\\\\"; + newl = 2; + } else fmt = wcs_nicechar_sel(c, &newl, NULL, flags & NICEFLAG_QUOTE); break; |
