]> git.ipfire.org Git - thirdparty/bash.git/commitdiff
Bash-4.2 patch 1
authorChet Ramey <chet.ramey@case.edu>
Wed, 23 Nov 2011 00:59:44 +0000 (19:59 -0500)
committerChet Ramey <chet.ramey@case.edu>
Wed, 23 Nov 2011 00:59:44 +0000 (19:59 -0500)
patchlevel.h
subst.c
subst.h

index 85940d03808330d19c61230b543a18789a678306..2c576f58a36bdbc28fc0c5b1b854e65777a872a5 100644 (file)
@@ -25,6 +25,6 @@
    regexp `^#define[   ]*PATCHLEVEL', since that's what support/mkversion.sh
    looks for to find the patch level (for the sccs version string). */
 
-#define PATCHLEVEL 0
+#define PATCHLEVEL 1
 
 #endif /* _PATCHLEVEL_H_ */
diff --git a/subst.c b/subst.c
index 0e83e56e474822ebdbbbdd092fb25d0bce1bd3e8..7ba15c6293a7111fd187399eebab1b2558944ede 100644 (file)
--- a/subst.c
+++ b/subst.c
@@ -1379,10 +1379,12 @@ extract_dollar_brace_string (string, sindex, quoted, flags)
   slen = strlen (string + *sindex) + *sindex;
 
   /* The handling of dolbrace_state needs to agree with the code in parse.y:
-     parse_matched_pair() */
-  dolbrace_state = 0;
-  if (quoted & (Q_HERE_DOCUMENT|Q_DOUBLE_QUOTES))
-    dolbrace_state = (flags & SX_POSIXEXP) ? DOLBRACE_QUOTE : DOLBRACE_PARAM;
+     parse_matched_pair().  The different initial value is to handle the
+     case where this function is called to parse the word in
+     ${param op word} (SX_WORD). */
+  dolbrace_state = (flags & SX_WORD) ? DOLBRACE_WORD : DOLBRACE_PARAM;
+  if ((quoted & (Q_HERE_DOCUMENT|Q_DOUBLE_QUOTES)) && (flags & SX_POSIXEXP))
+    dolbrace_state = DOLBRACE_QUOTE;
 
   i = *sindex;
   while (c = string[i])
@@ -7176,7 +7178,7 @@ parameter_brace_expand (string, indexp, quoted, pflags, quoted_dollar_atp, conta
     {
       /* Extract the contents of the ${ ... } expansion
         according to the Posix.2 rules. */
-      value = extract_dollar_brace_string (string, &sindex, quoted, (c == '%' || c == '#') ? SX_POSIXEXP : 0);
+      value = extract_dollar_brace_string (string, &sindex, quoted, (c == '%' || c == '#' || c =='/' || c == '^' || c == ',' || c ==':') ? SX_POSIXEXP|SX_WORD : SX_WORD);
       if (string[sindex] == RBRACE)
        sindex++;
       else
diff --git a/subst.h b/subst.h
index ae388fd53dcf68a1cce42954bfd1880acb5c6136..914fffebf3ae01d845ef4aac9b37351ef7ee49d5 100644 (file)
--- a/subst.h
+++ b/subst.h
@@ -56,6 +56,7 @@
 #define SX_NOLONGJMP   0x0040  /* don't longjmp on fatal error */
 #define SX_ARITHSUB    0x0080  /* extracting $(( ... )) (currently unused) */
 #define SX_POSIXEXP    0x0100  /* extracting new Posix pattern removal expansions in extract_dollar_brace_string */
+#define SX_WORD                0x0200  /* extracting word in ${param op word} */
 
 /* Remove backslashes which are quoting backquotes from STRING.  Modifies
    STRING, and returns a pointer to it. */