mirror of
https://https.git.savannah.gnu.org/git/bash.git
synced 2026-07-16 16:36:03 +02:00
changes for backslashes in glob patterns and single-quoted strings; brace expansion knows '${...}' expansions; read returns status 2 if trying to assign to a readonly variable
This commit is contained in:
+4
-2
@@ -45,7 +45,7 @@
|
||||
that we're translating a string for `echo -e', and therefore should not
|
||||
treat a single quote as a character that may be escaped with a backslash.
|
||||
If (FLAGS&2) is non-zero, we're expanding for the parser and want to
|
||||
quote CTLESC and CTLNUL with CTLESC. If (flags&4) is non-zero, we want
|
||||
quote CTLESC and CTLNUL with CTLESC. If (FLAGS&4) is non-zero, we want
|
||||
to remove the backslash before any unrecognized escape sequence. */
|
||||
char *
|
||||
ansicstr (const char *string, size_t len, int flags, int *sawc, size_t *rlen)
|
||||
@@ -198,7 +198,9 @@ ansicstr (const char *string, size_t len, int flags, int *sawc, size_t *rlen)
|
||||
s++;
|
||||
if ((flags & 2) && c == '\\' && c == *s)
|
||||
s++; /* Posix requires $'\c\\' do backslash escaping */
|
||||
c = TOCTRL(c);
|
||||
else if ((flags & 2) && c == CTLESC && (*s == CTLESC || *s == CTLNUL))
|
||||
c = *s++;
|
||||
c = TOCTRL(c);
|
||||
break;
|
||||
}
|
||||
/*FALLTHROUGH*/
|
||||
|
||||
Reference in New Issue
Block a user