mksh R40 Release Candidate 1
Testsuite: • add new need-pass: {yes|no} attribute, default yes • exit with 1 if a need-pass test failed unexpectedly idea by Kacper Kornet <draenog@pld-linux.org> • mark utf8bom-2 as need-pass: no Infrstructure: • add housekeeping function for making a tty raw • switch functions with unused results to void • struct op: u.charflag contains last char of ;; in TPAT • var.c:arraysearch is now a global function Language: • add ;& (fall through) and ;| (examine next) delimiters in addition to ;; (end case) as zsh extensions, because POSIX standardised on ;& already • add -A (read into array), -N (read exactly n bytes), -n (read up to n bytes), -t (timeout) flags for read from ksh93 • allow read -N -1 or -n -1 to slurp the entire input • add -a (read into array the input characters) extension specific to mksh to read, idea by David Korn • add -e (exit with error if PWD was not set correctly after a physical cd) to cd builtin, mandated by next POSIX, and change error codes accordingly Rewrites: • full rewrite of read builtin and its manpage section • add regression tetss for most of the new functionality • duplicate hexdump demo tests for use of read -a • use read -raN-1 in dot.mkshrc to get NUL safe base64, DJB cdb hash and Jenkins one-at-a-time hash functions
This commit is contained in:
9
tree.c
9
tree.c
@@ -22,7 +22,7 @@
|
||||
|
||||
#include "sh.h"
|
||||
|
||||
__RCSID("$MirOS: src/bin/mksh/tree.c,v 1.48 2011/05/07 00:24:35 tg Exp $");
|
||||
__RCSID("$MirOS: src/bin/mksh/tree.c,v 1.49 2011/05/29 02:18:57 tg Exp $");
|
||||
|
||||
#define INDENT 8
|
||||
|
||||
@@ -100,7 +100,7 @@ ptree(struct op *t, int indent, struct shf *shf)
|
||||
case TSELECT:
|
||||
case TFOR:
|
||||
fptreef(shf, indent, "%s %s ",
|
||||
(t->type == TFOR) ? "for" : "select", t->str);
|
||||
(t->type == TFOR) ? "for" : T_select, t->str);
|
||||
if (t->vars != NULL) {
|
||||
shf_puts("in ", shf);
|
||||
w = (const char **)t->vars;
|
||||
@@ -121,7 +121,8 @@ ptree(struct op *t, int indent, struct shf *shf)
|
||||
(w[1] != NULL) ? '|' : ')');
|
||||
++w;
|
||||
}
|
||||
fptreef(shf, indent + INDENT, "%N%T%N;;", t1->left);
|
||||
fptreef(shf, indent + INDENT, "%N%T%N;%c", t1->left,
|
||||
t1->u.charflag);
|
||||
}
|
||||
fptreef(shf, indent, "%Nesac ");
|
||||
break;
|
||||
@@ -949,7 +950,7 @@ dumptree(struct shf *shf, struct op *t)
|
||||
shf_putc(')', shf);
|
||||
shf_putc('\n', shf);
|
||||
dumptree(shf, t1->left);
|
||||
shf_fprintf(shf, " /%d]", i++);
|
||||
shf_fprintf(shf, " ;%c/%d]", t1->u.charflag, i++);
|
||||
}
|
||||
break;
|
||||
OPEN(TWHILE)
|
||||
|
Reference in New Issue
Block a user