millert@ says (but we've already got it all in, only update comments)

Restore sp before calling snptreef() so the error message contains
the actual expression that caused the error.  OK otto@

while here, nice-ify a #define, and bump the mksh version number
to R20 which I somehow forgot... need sleep
This commit is contained in:
tg 2004-12-14 15:54:26 +00:00
parent ec77eafff5
commit 60f7d03fb5
3 changed files with 11 additions and 10 deletions

11
eval.c
View File

@ -1,5 +1,5 @@
/** $MirBSD: src/bin/ksh/eval.c,v 2.3 2004/12/13 19:05:09 tg Exp $ */ /** $MirBSD: src/bin/ksh/eval.c,v 2.4 2004/12/14 15:54:23 tg Exp $ */
/* $OpenBSD: eval.c,v 1.16 2004/12/08 21:23:18 millert Exp $ */ /* $OpenBSD: eval.c,v 1.18 2004/12/13 16:37:06 millert Exp $ */
/* /*
* Expansion - quoting, separation, substitution, globbing * Expansion - quoting, separation, substitution, globbing
@ -10,7 +10,7 @@
#include "ksh_dir.h" #include "ksh_dir.h"
#include "ksh_stat.h" #include "ksh_stat.h"
__RCSID("$MirBSD: src/bin/ksh/eval.c,v 2.3 2004/12/13 19:05:09 tg Exp $"); __RCSID("$MirBSD: src/bin/ksh/eval.c,v 2.4 2004/12/14 15:54:23 tg Exp $");
/* /*
* string expansion * string expansion
@ -1010,8 +1010,9 @@ globit(XString *xs, char **xpp, char *sp, XPtrV *wp, int check)
if ((check & GF_EXCHECK) if ((check & GF_EXCHECK)
|| ((check & GF_MARKDIR) && (check & GF_GLOBBED))) || ((check & GF_MARKDIR) && (check & GF_GLOBBED)))
{ {
#define stat_check() (stat_done ? stat_done : \ #define stat_check() \
(stat_done = stat(Xstring(*xs, xp), &statb) < 0 \ (stat_done ? stat_done : \
((stat_done = stat(Xstring(*xs, xp), &statb) < 0) \
? -1 : 1)) ? -1 : 1))
struct stat lstatb, statb; struct stat lstatb, statb;
int stat_done = 0; /* -1: failed, 1 ok */ int stat_done = 0; /* -1: failed, 1 ok */

6
main.c
View File

@ -1,4 +1,4 @@
/** $MirBSD: src/bin/ksh/main.c,v 2.5 2004/12/13 19:09:06 tg Exp $ */ /** $MirBSD: src/bin/ksh/main.c,v 2.6 2004/12/14 15:54:24 tg Exp $ */
/* $OpenBSD: main.c,v 1.28 2004/08/23 14:56:32 millert Exp $ */ /* $OpenBSD: main.c,v 1.28 2004/08/23 14:56:32 millert Exp $ */
/* /*
@ -15,7 +15,7 @@
* shell version * shell version
*/ */
__RCSID("$MirBSD: src/bin/ksh/main.c,v 2.5 2004/12/13 19:09:06 tg Exp $"); __RCSID("$MirBSD: src/bin/ksh/main.c,v 2.6 2004/12/14 15:54:24 tg Exp $");
static const char version_param[] = static const char version_param[] =
#ifdef KSH #ifdef KSH
@ -26,7 +26,7 @@ static const char version_param[] =
; ;
const char ksh_version[] = const char ksh_version[] =
"@(#)PD KSH v5.2.14 MirOS R19 in " "@(#)PD KSH v5.2.14 MirOS R20 in "
#ifdef MIRBSD_NATIVE #ifdef MIRBSD_NATIVE
"native " "native "
#endif #endif

View File

@ -5,5 +5,5 @@ category: pdksh
stdin: stdin:
echo $KSH_VERSION echo $KSH_VERSION
expected-stdout-pattern: expected-stdout-pattern:
/PD KSH v5\.2\.14 MirOS R19 in (native )?KSH mode( as mksh)?/ /PD KSH v5\.2\.14 MirOS R20 in (native )?KSH mode( as mksh)?/
--- ---