disallow some more kinds to trim a vector; Debian #581867

This commit is contained in:
tg 2010-05-16 19:04:42 +00:00
parent 020ce07d14
commit f24e2c80a9
3 changed files with 7 additions and 5 deletions

View File

@ -1,4 +1,4 @@
# $MirOS: src/bin/mksh/check.t,v 1.375 2010/04/27 21:39:06 tg Exp $
# $MirOS: src/bin/mksh/check.t,v 1.376 2010/05/16 19:04:40 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 $
@ -25,7 +25,7 @@
# http://www.research.att.com/~gsf/public/ifs.sh
expected-stdout:
@(#)MIRBSD KSH R39 2010/04/27
@(#)MIRBSD KSH R39 2010/05/16
description:
Check version of shell.
stdin:

4
eval.c
View File

@ -22,7 +22,7 @@
#include "sh.h"
__RCSID("$MirOS: src/bin/mksh/eval.c,v 1.87 2010/04/20 09:10:07 tg Exp $");
__RCSID("$MirOS: src/bin/mksh/eval.c,v 1.88 2010/05/16 19:04:41 tg Exp $");
/*
* string expansion
@ -1020,6 +1020,8 @@ varsub(Expand *xp, const char *sp, const char *word,
case '=': /* can't assign to a vector */
case '%': /* can't trim a vector (yet) */
case '#':
case '0':
case '/':
return (-1);
}
if (e->loc->argc == 0) {

4
sh.h
View File

@ -150,9 +150,9 @@
#endif
#ifdef EXTERN
__RCSID("$MirOS: src/bin/mksh/sh.h,v 1.390 2010/04/27 21:39:09 tg Exp $");
__RCSID("$MirOS: src/bin/mksh/sh.h,v 1.391 2010/05/16 19:04:42 tg Exp $");
#endif
#define MKSH_VERSION "R39 2010/04/27"
#define MKSH_VERSION "R39 2010/05/16"
#ifndef MKSH_INCLUDES_ONLY