add a testcase as documentation (why POSIX isn’t everything); fix comments

This commit is contained in:
tg 2016-07-25 20:36:28 +00:00
parent c3e794c4d0
commit aa9fa0ebfe
3 changed files with 17 additions and 5 deletions

14
check.t
View File

@ -1,4 +1,4 @@
# $MirOS: src/bin/mksh/check.t,v 1.741 2016/07/25 00:04:37 tg Exp $
# $MirOS: src/bin/mksh/check.t,v 1.742 2016/07/25 20:36:24 tg Exp $
# -*- mode: sh -*-
#-
# Copyright © 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010,
@ -359,6 +359,18 @@ stdin:
expected-stdout:
20
---
name: arith-prec-1
description:
Prove arithmetic expressions with embedded parameter
substitutions cannot be parsed ahead of time
stdin:
a='3 + 4'
print 1 $((2 * a)) .
print 2 $((2 * $a)) .
expected-stdout:
1 14 .
2 10 .
---
name: arith-div-assoc-1
description:
Check associativity of division operator

4
main.c
View File

@ -34,7 +34,7 @@
#include <locale.h>
#endif
__RCSID("$MirOS: src/bin/mksh/main.c,v 1.312 2016/07/25 00:04:45 tg Exp $");
__RCSID("$MirOS: src/bin/mksh/main.c,v 1.313 2016/07/25 20:36:27 tg Exp $");
extern char **environ;
@ -317,7 +317,7 @@ main_init(int argc, const char *argv[], Source **sp, struct block **lp)
#endif
/*
* this is uniform across all OSes unless it
* breaks somewhere; don't try to optimise,
* breaks somewhere hard; don't try to optimise,
* e.g. add stuff for Interix or remove /usr
* for HURD, because e.g. Debian GNU/HURD is
* "keeping a regular /usr"; this is supposed

4
misc.c
View File

@ -30,7 +30,7 @@
#include <grp.h>
#endif
__RCSID("$MirOS: src/bin/mksh/misc.c,v 1.243 2016/07/25 00:04:45 tg Exp $");
__RCSID("$MirOS: src/bin/mksh/misc.c,v 1.244 2016/07/25 20:36:28 tg Exp $");
#define KSH_CHVT_FLAG
#ifdef MKSH_SMALL
@ -354,7 +354,7 @@ change_xtrace(unsigned char newval, bool dosnapshot)
*/
int
parse_args(const char **argv,
/* OF_CMDLINE or OF_SET */
/* OF_FIRSTTIME, OF_CMDLINE, or OF_SET */
int what,
bool *setargsp)
{