mirror of
git://git.code.sf.net/p/zsh/code
synced 2025-06-08 18:18:02 +02:00
27827: fix infinite loop in recursive alias at end of parsed string
This commit is contained in:
parent
c2fdffa316
commit
e71df91bd2
3 changed files with 25 additions and 10 deletions
|
@ -1,3 +1,9 @@
|
||||||
|
2010-03-25 Peter Stephenson <pws@csr.com>
|
||||||
|
|
||||||
|
* 27827: Src/input.c, Test/A02alias.ztst: infinite loop
|
||||||
|
if alias with recursive definition occurred at end
|
||||||
|
of parsed string (normal shell input was OK).
|
||||||
|
|
||||||
2010-03-22 Peter Stephenson <p.w.stephenson@ntlworld.com>
|
2010-03-22 Peter Stephenson <p.w.stephenson@ntlworld.com>
|
||||||
|
|
||||||
* 27823: Src/hist.c: 27822 could access freed memory because
|
* 27823: Src/hist.c: 27822 could access freed memory because
|
||||||
|
@ -12959,5 +12965,5 @@
|
||||||
|
|
||||||
*****************************************************
|
*****************************************************
|
||||||
* This is used by the shell to define $ZSH_PATCHLEVEL
|
* This is used by the shell to define $ZSH_PATCHLEVEL
|
||||||
* $Revision: 1.4943 $
|
* $Revision: 1.4944 $
|
||||||
*****************************************************
|
*****************************************************
|
||||||
|
|
21
Src/input.c
21
Src/input.c
|
@ -195,21 +195,24 @@ ingetc(void)
|
||||||
return lastc;
|
return lastc;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* See if we have reached the end of input
|
||||||
|
* (due to an error, or to reading from a single string).
|
||||||
|
* Check the remaining characters left, since if there aren't
|
||||||
|
* any we don't want to pop the stack---it'll mark any aliases
|
||||||
|
* as not in use before we've finished processing.
|
||||||
|
*/
|
||||||
|
if (!inbufct && (strin || errflag)) {
|
||||||
|
lexstop = 1;
|
||||||
|
return ' ';
|
||||||
|
}
|
||||||
/* If the next element down the input stack is a continuation of
|
/* If the next element down the input stack is a continuation of
|
||||||
* this, use it.
|
* this, use it.
|
||||||
*/
|
*/
|
||||||
if (inbufflags & INP_CONT) {
|
if (inbufflags & INP_CONT) {
|
||||||
inpoptop();
|
inpoptop();
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
/*
|
|
||||||
* Otherwise, see if we have reached the end of input
|
|
||||||
* (due to an error, or to reading from a single string).
|
|
||||||
*/
|
|
||||||
if (strin || errflag) {
|
|
||||||
lexstop = 1;
|
|
||||||
return ' ';
|
|
||||||
}
|
|
||||||
/* As a last resort, get some more input */
|
/* As a last resort, get some more input */
|
||||||
if (inputline())
|
if (inputline())
|
||||||
return ' ';
|
return ' ';
|
||||||
|
|
|
@ -36,3 +36,9 @@
|
||||||
>Without
|
>Without
|
||||||
>This command has the argument true
|
>This command has the argument true
|
||||||
>With
|
>With
|
||||||
|
|
||||||
|
print -u $ZTST_fd 'This test hangs the shell when it fails...'
|
||||||
|
alias sort='LC_ALL=C sort'
|
||||||
|
cat <(echo foo | sort)
|
||||||
|
0:Alias expansion works at the end of parsed strings
|
||||||
|
>foo
|
||||||
|
|
Loading…
Reference in a new issue