mirror of
https://https.git.savannah.gnu.org/git/bash.git
synced 2026-06-29 16:39:53 +02:00
commit bash-20100715 snapshot
This commit is contained in:
@@ -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>
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -35,6 +35,7 @@ typedef struct compspec {
|
||||
char *suffix;
|
||||
char *funcname;
|
||||
char *command;
|
||||
char *lcommand;
|
||||
char *filterpat;
|
||||
} COMPSPEC;
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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
|
||||
|
||||
+1
-1
@@ -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
|
||||
|
||||
|
||||
@@ -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)"
|
||||
"
|
||||
|
||||
@@ -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)"
|
||||
"
|
||||
|
||||
@@ -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
|
||||
)
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user