]> git.ipfire.org Git - thirdparty/bash.git/commitdiff
commit bash-20100715 snapshot
authorChet Ramey <chet.ramey@case.edu>
Tue, 13 Dec 2011 03:02:52 +0000 (22:02 -0500)
committerChet Ramey <chet.ramey@case.edu>
Tue, 13 Dec 2011 03:02:52 +0000 (22:02 -0500)
12 files changed:
CWRU/CWRU.chlog
MANIFEST
MANIFEST~
parse.y
pcomplete.h
pcomplib.c
subst.c
tests/RUN-ONE-TEST
tests/comsub-posix.tests
tests/comsub-posix.tests~
tests/comsub-posix3.sub [new file with mode: 0644]
tests/comsub-posix3.sub~ [new file with mode: 0644]

index 99bc6e9df6d56d5dcb9fa978af07e77791b04020..a89609996665b496c8073f3fabd692af24e6d143 100644 (file)
@@ -10207,3 +10207,15 @@ subst.c
        - when performing pattern substitution word expansions, a `&' in the
          replacement string is replaced by the text matched by the pattern.
          The `&' can be quoted with a backslash to inhibit the expansion
+
+                                  7/13
+                                  ----
+pcomplib.[ch]
+       - new member for struct compspec: lcommand.  for future use
+
+                                  7/15
+                                  ----
+parse.y
+       - fix problem in parse_comsub where extra space was added to here-doc
+         delimiter if the first word in the comsub contained a `/'.  Fixes
+         bug reported by Alex Khesin <alexk@google.com>
index 3b2b747aa84734de4756cd4461ce0ca6029b40f7..2e9dfb77b693bfd1c0dcca8894e837b2e11e2938 100644 (file)
--- a/MANIFEST
+++ b/MANIFEST
@@ -804,6 +804,7 @@ tests/comsub-posix.tests    f
 tests/comsub-posix.right       f
 tests/comsub-posix1.sub        f
 tests/comsub-posix2.sub        f
+tests/comsub-posix3.sub        f
 tests/cond.tests       f
 tests/cond.right       f
 tests/cond-regexp.sub  f
index d8c2d99f0ed8df984341f4955a534972975564a3..3b2b747aa84734de4756cd4461ce0ca6029b40f7 100644 (file)
--- a/MANIFEST~
+++ b/MANIFEST~
@@ -908,6 +908,9 @@ tests/jobs2.sub             f
 tests/jobs3.sub                f
 tests/jobs4.sub                f
 tests/jobs.right       f
+tests/lastpipe.right   f
+tests/lastpipe.tests   f
+tests/lastpipe1.sub    f
 tests/mapfile.data     f
 tests/mapfile.right    f
 tests/mapfile.tests    f
@@ -1023,6 +1026,7 @@ tests/run-intl            f
 tests/run-iquote       f
 tests/run-invert       f
 tests/run-jobs         f
+tests/run-lastpipe     f
 tests/run-mapfile      f
 tests/run-more-exp     f
 tests/run-new-exp      f
diff --git a/parse.y b/parse.y
index af47fc78ff03fcb714cfd1db74a1c55d063c9aef..1b7f14abc95b74cdb0e138abd3f46e8063973e6f 100644 (file)
--- a/parse.y
+++ b/parse.y
@@ -3555,7 +3555,7 @@ eof_error:
        }
 
       /* Skip whitespace */
-      if MBTEST(shellblank (ch) && lex_rwlen == 0)
+      if MBTEST(shellblank (ch) && (tflags & LEX_HEREDELIM) == 0 && lex_rwlen == 0)
         {
          /* Add this character. */
          RESIZE_MALLOCED_BUFFER (ret, retind, 1, retsize, 64);
index dacbcefac96fc58f2cf6ba1b566002775c476c72..6c1a664cf7a28e9a9f4038f759f272cf0250f37b 100644 (file)
@@ -35,6 +35,7 @@ typedef struct compspec {
   char *suffix;
   char *funcname;
   char *command;
+  char *lcommand;
   char *filterpat;
 } COMPSPEC;
 
index fc4fbe4db856075dda911d93a800aba64425efb2..fe337e4aee3564a3ca31b937a291d5110bb99d52 100644 (file)
@@ -62,6 +62,7 @@ compspec_create ()
   ret->suffix = (char *)NULL;
   ret->funcname = (char *)NULL;
   ret->command = (char *)NULL;
+  ret->lcommand = (char *)NULL;
   ret->filterpat = (char *)NULL;
 
   return ret;
@@ -80,6 +81,7 @@ compspec_dispose (cs)
       FREE (cs->suffix);
       FREE (cs->funcname);
       FREE (cs->command);
+      FREE (cs->lcommand);
       FREE (cs->filterpat);
 
       free (cs);
@@ -104,6 +106,7 @@ compspec_copy (cs)
   new->suffix = STRDUP (cs->suffix);
   new->funcname = STRDUP (cs->funcname);
   new->command = STRDUP (cs->command);
+  new->lcommand = STRDUP (cs->lcommand);
   new->filterpat = STRDUP (cs->filterpat);
 
   return new;
diff --git a/subst.c b/subst.c
index d20b055e6f5682aeed2fb4e5be501b275dc58a80..f1f0d66394e8599cef9e66f2e7dde6f6a188aac7 100644 (file)
--- a/subst.c
+++ b/subst.c
@@ -6355,7 +6355,11 @@ pat_subst (string, pat, rep, mflags)
 
   mtype = mflags & MATCH_TYPEMASK;
 
+#if 0  /* bash-4.2 ? */
   rxpand = (rep && *rep) ? shouldexp_replacement (rep) : 0;
+#else
+  rxpand = 0;
+#endif
 
   /* Special cases:
    *   1.  A null pattern with mtype == MATCH_BEG means to prefix STRING
index 3efcf32d68e9722024b6ca9d67f9e81b2aa5ac04..72ec06a2c1fd8dde92acea5e8ac773e35f1d061b 100755 (executable)
@@ -1,4 +1,4 @@
-BUILD_DIR=/usr/local/build/chet/bash/bash-current
+BUILD_DIR=/usr/local/build/bash/bash-current
 THIS_SH=$BUILD_DIR/bash
 PATH=$PATH:$BUILD_DIR
 
index a2f6b3c2860f347cb802f7ce549588e50c7eb4e9..3f04e6a53f7e9798e7cab3e617f1b7a2603d05df 100644 (file)
@@ -200,6 +200,8 @@ ${THIS_SH} ./comsub-posix1.sub
 
 ${THIS_SH} ./comsub-posix2.sub
 
+${THIS_SH} ./comsub-posix3.sub
+
 # produced a parse error through bash-4.0-beta2
 : $(echo foo)"
 "
index d45cbf216a9b3f2e08b58375866eda8df31abd32..a2f6b3c2860f347cb802f7ce549588e50c7eb4e9 100644 (file)
@@ -198,6 +198,8 @@ eof
 
 ${THIS_SH} ./comsub-posix1.sub
 
+${THIS_SH} ./comsub-posix2.sub
+
 # produced a parse error through bash-4.0-beta2
 : $(echo foo)"
 "
diff --git a/tests/comsub-posix3.sub b/tests/comsub-posix3.sub
new file mode 100644 (file)
index 0000000..3a0e39a
--- /dev/null
@@ -0,0 +1,22 @@
+# parsing errors before bash-4.2
+
+a=$(/bin/cat << EOF | wc -l
+a
+b
+c
+EOF
+)
+
+a=$(cat << EOF | wc -l
+a
+b
+c
+EOF
+)
+
+a=$(/bin/cat << EOF
+a
+b
+c
+EOF
+)
diff --git a/tests/comsub-posix3.sub~ b/tests/comsub-posix3.sub~
new file mode 100644 (file)
index 0000000..6bf2d42
--- /dev/null
@@ -0,0 +1,23 @@
+# parsing errors before bash-4.2
+
+a=$(/bin/cat << EOF | wc -l
+a
+b
+c
+EOF
+)
+
+a=$(cat << EOF | wc -l
+a
+b
+c
+EOF
+)
+
+a=$(/bin/cat << EOF
+a
+b
+c
+EOF
+| wc -l)
+