- 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>
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
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
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
}
/* 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);
char *suffix;
char *funcname;
char *command;
+ char *lcommand;
char *filterpat;
} COMPSPEC;
ret->suffix = (char *)NULL;
ret->funcname = (char *)NULL;
ret->command = (char *)NULL;
+ ret->lcommand = (char *)NULL;
ret->filterpat = (char *)NULL;
return ret;
FREE (cs->suffix);
FREE (cs->funcname);
FREE (cs->command);
+ FREE (cs->lcommand);
FREE (cs->filterpat);
free (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;
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
-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
${THIS_SH} ./comsub-posix2.sub
+${THIS_SH} ./comsub-posix3.sub
+
# produced a parse error through bash-4.0-beta2
: $(echo foo)"
"
${THIS_SH} ./comsub-posix1.sub
+${THIS_SH} ./comsub-posix2.sub
+
# produced a parse error through bash-4.0-beta2
: $(echo foo)"
"
--- /dev/null
+# 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
+)
--- /dev/null
+# 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)
+