29731: fix read -AE, test that and read -Ae

This commit is contained in:
Peter Stephenson 2011-08-28 17:06:27 +00:00
parent ca7269e82d
commit af071465b1
3 changed files with 23 additions and 3 deletions

View file

@ -1,5 +1,8 @@
2011-08-28 Peter Stephenson <p.w.stephenson@ntlworld.com> 2011-08-28 Peter Stephenson <p.w.stephenson@ntlworld.com>
* 29731: Src/builtin.c, Test/B04read.ztst: fix output from `read
-AE' and test that and `read -Ae'.
* users/16289: Doc/Zsh/expn.yo, Src/exec.c, Src/jobs.c: don't * users/16289: Doc/Zsh/expn.yo, Src/exec.c, Src/jobs.c: don't
delete temporary files when disowning and document this. delete temporary files when disowning and document this.
@ -15335,5 +15338,5 @@
***************************************************** *****************************************************
* This is used by the shell to define $ZSH_PATCHLEVEL * This is used by the shell to define $ZSH_PATCHLEVEL
* $Revision: 1.5446 $ * $Revision: 1.5447 $
***************************************************** *****************************************************

View file

@ -5549,7 +5549,7 @@ bin_read(char *name, char **args, Options ops, UNUSED(int func))
*bptr = '\0'; *bptr = '\0';
#endif #endif
/* dispose of word appropriately */ /* dispose of word appropriately */
if (OPT_ISSET(ops,'e') || OPT_ISSET(ops,'E')) { if (OPT_ISSET(ops,'e')) {
zputs(buf, stdout); zputs(buf, stdout);
putchar('\n'); putchar('\n');
} }
@ -5581,7 +5581,7 @@ bin_read(char *name, char **args, Options ops, UNUSED(int func))
: (char **)zalloc((al + 1) * sizeof(char *))); : (char **)zalloc((al + 1) * sizeof(char *)));
for (pp = p, n = firstnode(readll); n; incnode(n)) { for (pp = p, n = firstnode(readll); n; incnode(n)) {
if (OPT_ISSET(ops,'e') || OPT_ISSET(ops,'E')) { if (OPT_ISSET(ops,'E')) {
zputs((char *) getdata(n), stdout); zputs((char *) getdata(n), stdout);
putchar('\n'); putchar('\n');
} }

View file

@ -93,3 +93,20 @@
read foo) <<<bar read foo) <<<bar
1:return status on failing to set parameter 1:return status on failing to set parameter
?(eval):2: read-only variable: foo ?(eval):2: read-only variable: foo
read -AE array <<<'one two three'
print ${(j.:.)array}
0:Behaviour of -A and -E combination
>one
>two
>three
>one:two:three
array=()
read -Ae array <<<'four five six'
print ${(j.:.)array}
0:Behaviour of -A and -e combination
>four
>five
>six
>