mirror of
git://git.code.sf.net/p/zsh/code
synced 2025-01-01 05:16:05 +01:00
28590: make read return status non-zero on error
This commit is contained in:
parent
21ee383e28
commit
a89f0559c2
3 changed files with 15 additions and 2 deletions
|
@ -1,5 +1,8 @@
|
|||
2011-01-07 Peter Stephenson <pws@csr.com>
|
||||
|
||||
* 28590 (added a comment): Src/builtin.c, Test/B04read.ztst:
|
||||
read builtin should return non-zero status on error.
|
||||
|
||||
* Mikael: 28585: Completion/Unix/Command/_mkdir: don't set ret=0
|
||||
when _wanted fails to find any matches.
|
||||
|
||||
|
@ -14066,5 +14069,5 @@
|
|||
|
||||
*****************************************************
|
||||
* This is used by the shell to define $ZSH_PATCHLEVEL
|
||||
* $Revision: 1.5174 $
|
||||
* $Revision: 1.5175 $
|
||||
*****************************************************
|
||||
|
|
|
@ -5710,7 +5710,12 @@ bin_read(char *name, char **args, Options ops, UNUSED(int func))
|
|||
}
|
||||
return 1;
|
||||
}
|
||||
return 0;
|
||||
/*
|
||||
* The following is to ensure a failure to set the parameter
|
||||
* causes a non-zero status return. There are arguments for
|
||||
* turning a non-zero status into errflag more widely.
|
||||
*/
|
||||
return errflag;
|
||||
}
|
||||
|
||||
/**/
|
||||
|
|
|
@ -88,3 +88,8 @@
|
|||
print ${#line}
|
||||
0:read with trailing metafied characters
|
||||
>24
|
||||
|
||||
(typeset -r foo
|
||||
read foo) <<<bar
|
||||
1:return status on failing to set parameter
|
||||
?(eval):2: read-only variable: foo
|
||||
|
|
Loading…
Reference in a new issue