diff --git a/check.t b/check.t index 7eaccfc..ba3aaf9 100644 --- a/check.t +++ b/check.t @@ -1,4 +1,4 @@ -# $MirOS: src/bin/mksh/check.t,v 1.510 2012/01/03 15:32:05 tg Exp $ +# $MirOS: src/bin/mksh/check.t,v 1.511 2012/01/04 19:09:32 tg Exp $ # $OpenBSD: bksl-nl.t,v 1.2 2001/01/28 23:04:56 niklas Exp $ # $OpenBSD: history.t,v 1.5 2001/01/28 23:04:56 niklas Exp $ # $OpenBSD: read.t,v 1.3 2003/03/10 03:48:16 david Exp $ @@ -29,7 +29,7 @@ # http://www.freebsd.org/cgi/cvsweb.cgi/src/tools/regression/bin/test/regress.sh?rev=HEAD expected-stdout: - @(#)MIRBSD KSH R40 2012/01/03 + @(#)MIRBSD KSH R40 2012/01/04 description: Check version of shell. stdin: @@ -4999,6 +4999,29 @@ stdin: expected-stdout: ok --- +name: regression-66 +description: + Check that quoting is sane +stdin: + ac_space=' ' + ac_newline=' + ' + set | grep ^ac_ |& + set -A lines + while IFS= read -pr line; do + if [[ $line = *space* ]]; then + lines[0]=$line + else + lines[1]=$line + fi + done + for line in "${lines[@]}"; do + print -r -- "$line" + done +expected-stdout: + ac_space=' ' + ac_newline=$'\n' +--- name: readonly-0 description: Ensure readonly is honoured for assignments and unset diff --git a/misc.c b/misc.c index 34111c5..0191f87 100644 --- a/misc.c +++ b/misc.c @@ -29,7 +29,7 @@ #include #endif -__RCSID("$MirOS: src/bin/mksh/misc.c,v 1.180 2011/12/29 22:54:20 tg Exp $"); +__RCSID("$MirOS: src/bin/mksh/misc.c,v 1.181 2012/01/04 19:09:35 tg Exp $"); /* type bits for unsigned char */ unsigned char chtypes[UCHAR_MAX + 1]; @@ -1037,10 +1037,8 @@ print_value_quoted(struct shf *shf, const char *s) bool inquote = true; /* first, check whether any quotes are needed */ - while ((c = *p++) != 0) - if (c < 32) - break; - else if (ctype(*p, C_QUOTE)) + while ((c = *p++) >= 32) + if (ctype(c, C_QUOTE)) inquote = false; p = (const unsigned char *)s; diff --git a/sh.h b/sh.h index 81a943f..1e30754 100644 --- a/sh.h +++ b/sh.h @@ -152,9 +152,9 @@ #endif #ifdef EXTERN -__RCSID("$MirOS: src/bin/mksh/sh.h,v 1.518 2012/01/03 01:01:44 tg Exp $"); +__RCSID("$MirOS: src/bin/mksh/sh.h,v 1.519 2012/01/04 19:09:36 tg Exp $"); #endif -#define MKSH_VERSION "R40 2012/01/03" +#define MKSH_VERSION "R40 2012/01/04" /* arithmetic types: C implementation */ #if !HAVE_CAN_INTTYPES