Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/bin/sh PR/19832, PR/35423: Fix handling 0x81 and 0x82 charac...



details:   https://anonhg.NetBSD.org/src/rev/0c9638be213d
branches:  trunk
changeset: 344175:0c9638be213d
user:      christos <christos%NetBSD.org@localhost>
date:      Wed Mar 16 15:44:35 2016 +0000

description:
PR/19832, PR/35423: Fix handling 0x81 and 0x82 characters in expansions
($VAR etc) that are used to generate filenames for redirections. (from kre)

diffstat:

 bin/sh/expand.c |  8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

diffs (36 lines):

diff -r 5b348d866340 -r 0c9638be213d bin/sh/expand.c
--- a/bin/sh/expand.c   Wed Mar 16 15:43:38 2016 +0000
+++ b/bin/sh/expand.c   Wed Mar 16 15:44:35 2016 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: expand.c,v 1.96 2016/03/08 14:09:07 christos Exp $     */
+/*     $NetBSD: expand.c,v 1.97 2016/03/16 15:44:35 christos Exp $     */
 
 /*-
  * Copyright (c) 1991, 1993
@@ -37,7 +37,7 @@
 #if 0
 static char sccsid[] = "@(#)expand.c   8.5 (Berkeley) 5/15/95";
 #else
-__RCSID("$NetBSD: expand.c,v 1.96 2016/03/08 14:09:07 christos Exp $");
+__RCSID("$NetBSD: expand.c,v 1.97 2016/03/16 15:44:35 christos Exp $");
 #endif
 #endif /* not lint */
 
@@ -187,7 +187,7 @@
 argstr(char *p, int flag)
 {
        char c;
-       int quotes = flag & (EXP_FULL | EXP_CASE);      /* do CTLESC */
+       int quotes = flag & (EXP_FULL | EXP_CASE | EXP_REDIR);  /* do CTLESC */
        int firsteq = 1;
        const char *ifs = NULL;
        int ifs_split = EXP_IFS_SPLIT;
@@ -641,7 +641,7 @@
        int startloc;
        int varlen;
        int apply_ifs;
-       int quotes = flag & (EXP_FULL | EXP_CASE);
+       int quotes = flag & (EXP_FULL | EXP_CASE | EXP_REDIR);
 
        varflags = (unsigned char)*p++;
        subtype = varflags & VSTYPE;



Home | Main Index | Thread Index | Old Index