Update.
1999-07-02 Tim Waugh <tim@cyberelk.demon.co.uk> * posix/wordexp-test.c: Revert bogus 'unset IFS' change. It doesn't belong in the tests, but in the wordexp implementation. * posix/wordexp.c (exec_comm): Unset IFS so that subshells don't split fields.
This commit is contained in:
parent
8d93eb92af
commit
4708015f24
|
@ -1,3 +1,11 @@
|
||||||
|
1999-07-02 Tim Waugh <tim@cyberelk.demon.co.uk>
|
||||||
|
|
||||||
|
* posix/wordexp-test.c: Revert bogus 'unset IFS' change. It
|
||||||
|
doesn't belong in the tests, but in the wordexp implementation.
|
||||||
|
|
||||||
|
* posix/wordexp.c (exec_comm): Unset IFS so that subshells don't
|
||||||
|
split fields.
|
||||||
|
|
||||||
1999-07-01 Cristian Gafton <gafton@redhat.com>
|
1999-07-01 Cristian Gafton <gafton@redhat.com>
|
||||||
|
|
||||||
* time/strptime.c (strptime): Initialize the tm struct first to avoid
|
* time/strptime.c (strptime): Initialize the tm struct first to avoid
|
||||||
|
|
|
@ -1285,7 +1285,7 @@ parameters.
|
||||||
|
|
||||||
A pointer to the buffer, in which the result is stored, is available in
|
A pointer to the buffer, in which the result is stored, is available in
|
||||||
@code{*@var{result}} after the function call successfully returned. If
|
@code{*@var{result}} after the function call successfully returned. If
|
||||||
an error occurs or if no entry is found, the pointer @code{*var{result}
|
an error occurs or if no entry is found, the pointer @code{*@var{result}}
|
||||||
is a null pointer. Success is signalled by a zero return value. If the
|
is a null pointer. Success is signalled by a zero return value. If the
|
||||||
function failed the return value is an error number. In addition to the
|
function failed the return value is an error number. In addition to the
|
||||||
errors defined for @code{gethostbyname} it can also be @code{ERANGE}.
|
errors defined for @code{gethostbyname} it can also be @code{ERANGE}.
|
||||||
|
|
|
@ -56,25 +56,25 @@ struct test_case_struct
|
||||||
* but does NOT start a new field. */
|
* but does NOT start a new field. */
|
||||||
{ 0, ":abc:", "$var", 0, 2, { "", "abc", }, ":" },
|
{ 0, ":abc:", "$var", 0, 2, { "", "abc", }, ":" },
|
||||||
|
|
||||||
{ 0, NULL, "$(unset IFS;echo :abc:)", 0, 2, { "", "abc", }, ":" },
|
{ 0, NULL, "$(echo :abc:)", 0, 2, { "", "abc", }, ":" },
|
||||||
{ 0, NULL, "$(unset IFS;echo :abc:\\ )", 0, 2, { "", "abc", }, ": " },
|
{ 0, NULL, "$(echo :abc:\\ )", 0, 2, { "", "abc", }, ": " },
|
||||||
{ 0, NULL, "$(unset IFS;echo :abc\\ )", 0, 2, { "", "abc", }, ": " },
|
{ 0, NULL, "$(echo :abc\\ )", 0, 2, { "", "abc", }, ": " },
|
||||||
{ 0, ":abc:", "$(unset IFS;echo $var)", 0, 2, { "", "abc", }, ":" },
|
{ 0, ":abc:", "$(echo $var)", 0, 2, { "", "abc", }, ":" },
|
||||||
{ 0, NULL, ":abc:", 0, 1, { ":abc:", }, ":" },
|
{ 0, NULL, ":abc:", 0, 1, { ":abc:", }, ":" },
|
||||||
{ 0, NULL, "$(unset IFS;echo :abc:)def", 0, 3, { "", "abc", "def", },
|
{ 0, NULL, "$(echo :abc:)def", 0, 3, { "", "abc", "def", },
|
||||||
":" },
|
":" },
|
||||||
{ 0, NULL, "$(unset IFS;echo abc:de)f", 0, 2, { "abc", "def", }, ":" },
|
{ 0, NULL, "$(echo abc:de)f", 0, 2, { "abc", "def", }, ":" },
|
||||||
{ 0, NULL, "$(unset IFS;echo abc:de)f:ghi", 0, 2, { "abc", "def:ghi", },
|
{ 0, NULL, "$(echo abc:de)f:ghi", 0, 2, { "abc", "def:ghi", },
|
||||||
":" },
|
":" },
|
||||||
{ 0, NULL, "abc:d$(unset IFS;echo ef:ghi)", 0, 2, { "abc:def", "ghi", },
|
{ 0, NULL, "abc:d$(echo ef:ghi)", 0, 2, { "abc:def", "ghi", },
|
||||||
":" },
|
":" },
|
||||||
{ 0, "abc:", "$var$(unset IFS;echo def:ghi)", 0, 3, { "abc", "def",
|
{ 0, "abc:", "$var$(echo def:ghi)", 0, 3, { "abc", "def",
|
||||||
"ghi", }, ":" },
|
"ghi", }, ":" },
|
||||||
{ 0, "abc:d", "$var$(unset IFS;echo ef:ghi)", 0, 3, { "abc", "def",
|
{ 0, "abc:d", "$var$(echo ef:ghi)", 0, 3, { "abc", "def",
|
||||||
"ghi", }, ":" },
|
"ghi", }, ":" },
|
||||||
{ 0, "def:ghi", "$(unset IFS;echo abc:)$var", 0, 3, { "abc", "def",
|
{ 0, "def:ghi", "$(echo abc:)$var", 0, 3, { "abc", "def",
|
||||||
"ghi", }, ":" },
|
"ghi", }, ":" },
|
||||||
{ 0, "ef:ghi", "$(unset IFS;echo abc:d)$var", 0, 3, { "abc", "def",
|
{ 0, "ef:ghi", "$(echo abc:d)$var", 0, 3, { "abc", "def",
|
||||||
"ghi", }, ":" },
|
"ghi", }, ":" },
|
||||||
|
|
||||||
/* Simple parameter expansion */
|
/* Simple parameter expansion */
|
||||||
|
|
|
@ -859,6 +859,9 @@ exec_comm (char *comm, char **word, size_t *word_length, size_t *max_length,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Make sure the subshell doesn't field-split on our behalf. */
|
||||||
|
unsetenv ("IFS");
|
||||||
|
|
||||||
__close (fildes[0]);
|
__close (fildes[0]);
|
||||||
__execve (_PATH_BSHELL, (char *const *) args, __environ);
|
__execve (_PATH_BSHELL, (char *const *) args, __environ);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue