commit bash-20150515 snapshot

This commit is contained in:
Chet Ramey
2015-06-05 11:48:51 -04:00
parent 34ec187607
commit 74b8cbb413
15 changed files with 148 additions and 31 deletions
+1 -1
View File
@@ -1859,7 +1859,7 @@ sv_isrchterm (value)
}
else
{
for (beg = end = 0; whitespace (v[end]) == 0; end++)
for (beg = end = 0; v[end] && whitespace (v[end]) == 0; end++)
;
}
+7
View File
@@ -246,6 +246,13 @@ sh_backslash_quote (string, table, flags)
for (r = result, s = string; s && (c = *s); s++)
{
#if defined (HANDLE_MULTIBYTE)
/* XXX - isascii, even if is_basic(c) == 0 - works in most cases. */
if (c >= 0 && c <= 127 && backslash_table[(unsigned char)c] == 1)
{
*r++ = '\\';
*r++ = c;
continue;
}
if (MB_CUR_MAX > 1 && is_basic (c) == 0)
{
COPY_CHAR_P (r, s, send);
+3 -2
View File
@@ -312,8 +312,9 @@ ansic_wshouldquote (string)
slen = mbstowcs (wcstr, string, 0);
if (slen == -1)
slen = 0;
if (slen == (size_t)-1)
return 1;
wcstr = (wchar_t *)xmalloc (sizeof (wchar_t) * (slen + 1));
mbstowcs (wcstr, string, slen + 1);