commit bash-20150612 snapshot

This commit is contained in:
Chet Ramey
2015-06-17 08:34:54 -04:00
parent 1573ba78f3
commit bd6a350e7e
20 changed files with 220 additions and 53 deletions
+13
View File
@@ -3750,6 +3750,11 @@ dequote_string (string)
char *result, *send;
DECLARE_MBSTATE;
#if defined (DEBUG)
if (string[0] == CTLESC && string[1] == 0)
itrace("dequote_string: string with bare CTLESC");
#endif
slen = strlen (string);
t = result = (char *)xmalloc (slen + 1);
@@ -3760,6 +3765,14 @@ dequote_string (string)
return (result);
}
/* A string consisting of only a single CTLESC should pass through unchanged */
if (string[0] == CTLESC && string[1] == 0)
{
result[0] = CTLESC;
result[1] = '\0';
return (result);
}
/* If no character in the string can be quoted, don't bother examining
each character. Just return a copy of the string passed to us. */
if (strchr (string, CTLESC) == NULL)