1
0
Fork 0
mirror of git://git.code.sf.net/p/zsh/code synced 2025-08-11 02:51:07 +02:00

23136: handle Bnulls now added in $'...'

This commit is contained in:
Peter Stephenson 2007-01-27 19:01:11 +00:00
parent 040db61c32
commit df54eeed2c
3 changed files with 29 additions and 9 deletions

View file

@ -1,3 +1,8 @@
2007-01-27 Peter Stephenson <p.w.stephenson@ntlworld.com>
* 23136: Src/utils.c, Test/A03quoting.ztst: 23097 added Bnulls
for backslashes in $'...' strings but then didn't handle them.
2007-01-26 Wayne Davison <wayned@users.sourceforge.net> 2007-01-26 Wayne Davison <wayned@users.sourceforge.net>
* unposted: Src/Zle/zle_tricky.c: fixed the error checking of * unposted: Src/Zle/zle_tricky.c: fixed the error checking of

View file

@ -4914,23 +4914,34 @@ getkeystring(char *s, int *len, int how, int *misc)
} else if (*s == Meta) } else if (*s == Meta)
*t++ = *++s ^ 32; *t++ = *++s ^ 32;
else { else {
*t++ = *s;
if (itok(*s)) { if (itok(*s)) {
if (meta || control) { if (meta || control) {
/* /*
* Presumably we should be using meta or control * Presumably we should be using meta or control
* on the character representing the token. * on the character representing the token.
*/ */
*s = ztokens[*s - Pound]; *t++ = ztokens[*s - Pound];
} else if (how & GETKEY_DOLLAR_QUOTE) { } else if (how & GETKEY_DOLLAR_QUOTE) {
/* if (*s == Bnull) {
* We don't want to metafy this, it's a real /*
* token. * Bnull is a backslash which quotes a couple
*/ * of special characters that always appear
*tdest++ = *s; * literally next. See strquote handling
* in gettokstr() in lex.c.
*/
*tdest++ = *++s;
} else {
/*
* We don't want to metafy this, it's a real
* token.
*/
*tdest++ = *s;
}
continue; continue;
} } else
} *t++ = *s;
} else
*t++ = *s;
} }
if (meta == 2) { if (meta == 2) {
t[-1] |= 0x80; t[-1] |= 0x80;

View file

@ -13,6 +13,10 @@
>'ut queant laxis' >'ut queant laxis'
>"resonare fibris" >"resonare fibris"
print -r $'\'a \\\' is \'a backslash\' is \'a \\\''
0:$'-style quotes with backslashed backslashes
>'a \' is 'a backslash' is 'a \'
print -r '''' print -r ''''
setopt rcquotes setopt rcquotes
# We need to set rcquotes here for the next example since it is # We need to set rcquotes here for the next example since it is