Initial revision

This commit is contained in:
tg
2004-12-10 18:12:29 +00:00
parent 8a1afa6087
commit 7920708324
68 changed files with 248 additions and 121 deletions

9
eval.c
View File

@ -1,4 +1,4 @@
/** $MirBSD: eval.c,v 1.11 2004/12/10 22:21:25 tg Exp $ */
/** $MirBSD: src/bin/ksh/eval.c,v 1.1 2004/12/10 18:08:08 tg Exp $ */
/* $OpenBSD: eval.c,v 1.16 2004/12/08 21:23:18 millert Exp $ */
/*
@ -10,7 +10,7 @@
#include "ksh_dir.h"
#include "ksh_stat.h"
__RCSID("$MirBSD: eval.c,v 1.11 2004/12/10 22:21:25 tg Exp $");
__RCSID("$MirBSD: src/bin/ksh/eval.c,v 1.1 2004/12/10 18:08:08 tg Exp $");
/*
* string expansion
@ -287,12 +287,12 @@ expand(char *cp, XPtrV *wp, int f)
char endc;
char *str, *end;
sp = varname - 2; /* restore sp */
end = (char *) wdscan(sp, CSUBST);
/* ({) the } or x is already skipped */
endc = *end;
*end = EOS;
str = snptreef(NULL, 64, "%S", sp);
str = snptreef((char *) 0, 64, "%S",
varname - 1);
*end = endc;
errorf("%s: bad substitution", str);
}
@ -801,7 +801,6 @@ varsub(Expand *xp, char *sp, char *word, int *stypep, int *slenp)
case '=': /* can't assign to a vector */
case '%': /* can't trim a vector (yet) */
case '#':
case '?':
return -1;
}
XPinit(wv, 32);