diff --git a/check.t b/check.t index 43c1238..13f26b7 100644 --- a/check.t +++ b/check.t @@ -1,4 +1,4 @@ -# $MirOS: src/bin/mksh/check.t,v 1.383 2010/07/19 22:41:01 tg Exp $ +# $MirOS: src/bin/mksh/check.t,v 1.384 2010/07/21 11:31:13 tg Exp $ # $OpenBSD: bksl-nl.t,v 1.2 2001/01/28 23:04:56 niklas Exp $ # $OpenBSD: history.t,v 1.5 2001/01/28 23:04:56 niklas Exp $ # $OpenBSD: read.t,v 1.3 2003/03/10 03:48:16 david Exp $ @@ -25,7 +25,7 @@ # http://www.research.att.com/~gsf/public/ifs.sh expected-stdout: - @(#)MIRBSD KSH R39 2010/07/19 + @(#)MIRBSD KSH R39 2010/07/21 description: Check version of shell. stdin: @@ -185,6 +185,17 @@ expected-stdout: tf tf --- +name: alias-10 +description: + Check that recursion is detected/avoided in aliases. + Regression, introduced during an old bugfix. +stdin: + alias foo='print hello ' + alias bar='foo world' + echo $(bar) +expected-stdout: + hello world +--- name: arith-lazy-1 description: Check that only one side of ternary operator is evaluated diff --git a/lex.c b/lex.c index e7814de..f242f2a 100644 --- a/lex.c +++ b/lex.c @@ -22,7 +22,7 @@ #include "sh.h" -__RCSID("$MirOS: src/bin/mksh/lex.c,v 1.116 2010/07/17 22:09:36 tg Exp $"); +__RCSID("$MirOS: src/bin/mksh/lex.c,v 1.117 2010/07/21 11:31:15 tg Exp $"); /* * states while lexing word @@ -1110,7 +1110,7 @@ yylex(int cf) else { Source *s = source; - while (s->flags & SF_HASALIAS) + while (s && (s->flags & SF_HASALIAS)) if (s->u.tblp == p) return (LWORD); else diff --git a/sh.h b/sh.h index 5d0a9eb..9c387eb 100644 --- a/sh.h +++ b/sh.h @@ -150,9 +150,9 @@ #endif #ifdef EXTERN -__RCSID("$MirOS: src/bin/mksh/sh.h,v 1.399 2010/07/19 22:41:03 tg Exp $"); +__RCSID("$MirOS: src/bin/mksh/sh.h,v 1.400 2010/07/21 11:31:16 tg Exp $"); #endif -#define MKSH_VERSION "R39 2010/07/19" +#define MKSH_VERSION "R39 2010/07/21" #ifndef MKSH_INCLUDES_ONLY