mirror of
https://https.git.savannah.gnu.org/git/bash.git
synced 2026-08-11 04:30:44 +02:00
fixes to read/wait; revert change that processes $'...' quoting in here-documents unconditionally
This commit is contained in:
+15
-3
@@ -818,8 +818,7 @@ glob_vector (pat, dir, flags)
|
||||
|
||||
add_current = ((flags & (GX_ALLDIRS|GX_ADDCURDIR)) == (GX_ALLDIRS|GX_ADDCURDIR));
|
||||
|
||||
/* Scan the directory, finding all names that match.
|
||||
For each name that matches, allocate a struct globval
|
||||
/* Scan the directory, finding all names that match For each name that matches, allocate a struct globval
|
||||
on the stack and store the name in it.
|
||||
Chain those structs together; lastlink is the front of the chain. */
|
||||
while (1)
|
||||
@@ -901,6 +900,9 @@ glob_vector (pat, dir, flags)
|
||||
nextname = (char *) malloc (sdlen + 1);
|
||||
if (nextlink == 0 || nextname == 0)
|
||||
{
|
||||
if (firstmalloc && firstmalloc == nextlink)
|
||||
firstmalloc = 0;
|
||||
/* If we reset FIRSTMALLOC we can free this here. */
|
||||
FREE (nextlink);
|
||||
FREE (nextname);
|
||||
free (subdir);
|
||||
@@ -936,8 +938,18 @@ glob_vector (pat, dir, flags)
|
||||
nextname = (char *) malloc (D_NAMLEN (dp) + 1);
|
||||
if (nextlink == 0 || nextname == 0)
|
||||
{
|
||||
/* We free NEXTLINK here, since it won't be added to the
|
||||
LASTLINK chain. If we used malloc, and it returned non-
|
||||
NULL, firstmalloc will be set to something valid. If it's
|
||||
NEXTLINK, reset it before we free NEXTLINK to avoid
|
||||
duplicate frees. If not, it will be taken care of by the
|
||||
loop below with TMPLINK. */
|
||||
if (firstmalloc)
|
||||
FREE (nextlink);
|
||||
{
|
||||
if (firstmalloc == nextlink)
|
||||
firstmalloc = 0;
|
||||
FREE (nextlink);
|
||||
}
|
||||
FREE (nextname);
|
||||
lose = 1;
|
||||
break;
|
||||
|
||||
+2
-1
@@ -315,8 +315,9 @@ sh_backslash_quote (string, table, flags)
|
||||
/* Quote characters that get special treatment when in double quotes in STRING
|
||||
using backslashes. Return a new string. */
|
||||
char *
|
||||
sh_backslash_quote_for_double_quotes (string)
|
||||
sh_backslash_quote_for_double_quotes (string, flags)
|
||||
char *string;
|
||||
int flags;
|
||||
{
|
||||
unsigned char c;
|
||||
char *result, *r, *s, *send;
|
||||
|
||||
Reference in New Issue
Block a user