fixup tilde expansion comments; revert a few bogus dirsep changes

cf. <Pine.BSM.4.64L.1703112129500.29506@herc.mirbsd.org>
This commit is contained in:
tg
2017-03-11 22:49:56 +00:00
parent a112d69c56
commit bc4397e28a
3 changed files with 15 additions and 26 deletions

17
eval.c
View File

@ -23,7 +23,7 @@
#include "sh.h"
__RCSID("$MirOS: src/bin/mksh/eval.c,v 1.197 2017/02/17 22:40:12 tg Exp $");
__RCSID("$MirOS: src/bin/mksh/eval.c,v 1.198 2017/03/11 22:49:55 tg Exp $");
/*
* string expansion
@ -625,13 +625,12 @@ expand(
break;
case '=':
/*
* Enabling tilde expansion
* after :s here is
* non-standard ksh, but is
* consistent with rules for
* other assignments. Not
* sure what POSIX thinks of
* this.
* Tilde expansion for string
* variables in POSIX mode is
* governed by Austinbug 351.
* In non-POSIX mode historic
* ksh behaviour (enable it!)
* us followed.
* Not doing tilde expansion
* for integer variables is a
* non-POSIX thing - makes
@ -1717,7 +1716,7 @@ maybe_expand_tilde(const char *p, XString *dsp, char **dpp, bool isassign)
Xinit(ts, tp, 16, ATEMP);
/* : only for DOASNTILDE form */
while (p[0] == CHAR && !mksh_cdirsep(p[1]) &&
while (p[0] == CHAR && /* not cdirsep */ p[1] != '/' &&
(!isassign || p[1] != ':')) {
Xcheck(ts, tp);
*tp++ = p[1];