commit bash-20170915 snapshot

This commit is contained in:
Chet Ramey
2017-09-20 09:30:30 -04:00
parent a27e6ec35a
commit 1ebae4666c
6 changed files with 21 additions and 14 deletions
+8
View File
@@ -14301,3 +14301,11 @@ execute_cmd.c
(source/eval/unset) not run by the command builtin
(flags & CMD_COMMAND_BUILTIN == 0). Fixes bug reported by
Martijn Dekker <martijn@inlv.org>
9/17
----
builtins/printf.def
- asciicode: don't use mblen to check whether or not a character is a
valid multibyte character; use mbtowc right away and then inspect
the return value. Fixes bug reported by Stephane Chazelas
<stephane.chazelas@gmail.com>
+6 -7
View File
@@ -1245,18 +1245,17 @@ asciicode ()
register intmax_t ch;
#if defined (HANDLE_MULTIBYTE)
wchar_t wc;
size_t mblength, slen;
size_t slen;
int mblength;
#endif
DECLARE_MBSTATE;
#if defined (HANDLE_MULTIBYTE)
slen = strlen (garglist->word->word+1);
mblength = MBLEN (garglist->word->word+1, slen);
if (mblength > 1)
{
mblength = mbtowc (&wc, garglist->word->word+1, slen);
ch = wc; /* XXX */
}
wc = 0;
mblength = mbtowc (&wc, garglist->word->word+1, slen);
if (mblength > 0)
ch = wc; /* XXX */
else
#endif
ch = (unsigned char)garglist->word->word[1];
+3 -1
View File
@@ -6945,7 +6945,9 @@ arguments to a previous command into the current input line, or
fix errors in previous commands quickly.
.PP
History expansion is performed immediately after a complete line
is read, before the shell breaks it into words.
is read, before the shell breaks it into words, and is performed
on each line individually without taking quoting on previous lines into
account.
It takes place in two parts.
The first is to determine which line from the history list
to use during substitution.
+3 -1
View File
@@ -255,7 +255,9 @@ fix errors in previous commands quickly.
@ifset BashFeatures
History expansion is performed immediately after a complete line
is read, before the shell breaks it into words.
is read, before the shell breaks it into words, and is performed
on each line individually without taking quoting on previous lines into
account.
@end ifset
History expansion takes place in two parts. The first is to determine
-4
View File
@@ -230,8 +230,6 @@ ansic_quote (str, flags, rlen)
*r++ = '$';
*r++ = '\'';
s = str;
for (s = str; c = *s; s++)
{
b = l = 1; /* 1 == add backslash; 0 == no backslash */
@@ -305,11 +303,9 @@ ansic_wshouldquote (string)
{
const wchar_t *wcs;
wchar_t wcc;
wchar_t *wcstr = NULL;
size_t slen;
slen = mbstowcs (wcstr, string, 0);
if (slen == (size_t)-1)
+1 -1
View File
@@ -1,6 +1,6 @@
/* shell.c -- GNU's idea of the POSIX shell specification. */
/* Copyright (C) 1987-2017 Free Software Foundation, Inc.
/* Copyright (C) 1987-2015 Free Software Foundation, Inc.
This file is part of GNU Bash, the Bourne Again SHell.