svn commit: r213087 - in stable/8: bin/sh
tools/regression/bin/sh/builtins
Jilles Tjoelker
jilles at FreeBSD.org
Thu Sep 23 21:36:10 UTC 2010
Author: jilles
Date: Thu Sep 23 21:36:10 2010
New Revision: 213087
URL: http://svn.freebsd.org/changeset/base/213087
Log:
MFC r212339: sh: Fix 'read' if all chars before the first IFS char are
backslash-escaped.
Backslash-escaped characters did not set the flag for a non-IFS character.
Added:
stable/8/tools/regression/bin/sh/builtins/read4.0
- copied unchanged from r212339, head/tools/regression/bin/sh/builtins/read4.0
stable/8/tools/regression/bin/sh/builtins/read4.0.stdout
- copied unchanged from r212339, head/tools/regression/bin/sh/builtins/read4.0.stdout
Modified:
stable/8/bin/sh/miscbltin.c
Directory Properties:
stable/8/bin/sh/ (props changed)
stable/8/tools/regression/bin/sh/ (props changed)
Modified: stable/8/bin/sh/miscbltin.c
==============================================================================
--- stable/8/bin/sh/miscbltin.c Thu Sep 23 20:49:33 2010 (r213086)
+++ stable/8/bin/sh/miscbltin.c Thu Sep 23 21:36:10 2010 (r213087)
@@ -174,6 +174,7 @@ readcmd(int argc __unused, char **argv _
continue;
if (backslash) {
backslash = 0;
+ startword = 0;
if (c != '\n')
STPUTC(c, p);
continue;
Copied: stable/8/tools/regression/bin/sh/builtins/read4.0 (from r212339, head/tools/regression/bin/sh/builtins/read4.0)
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ stable/8/tools/regression/bin/sh/builtins/read4.0 Thu Sep 23 21:36:10 2010 (r213087, copy of r212339, head/tools/regression/bin/sh/builtins/read4.0)
@@ -0,0 +1,10 @@
+# $FreeBSD$
+
+printf '%s\n' '\a\ b c' | { read a b; printf '%s\n' "x${a}x${b}x"; }
+printf '%s\n' '\a b\ c' | { read a b; printf '%s\n' "x${a}x${b}x"; }
+printf '%s\n' '\a\:b:c' | { IFS=: read a b; printf '%s\n' "x${a}x${b}x"; }
+printf '%s\n' '\a:b\:c' | { IFS=: read a b; printf '%s\n' "x${a}x${b}x"; }
+printf '%s\n' '\\ a' | { read a b; printf '%s\n' "x${a}x${b}x"; }
+printf '%s\n' '\\:a' | { IFS=: read a b; printf '%s\n' "x${a}x${b}x"; }
+printf '%s\n' '\\\ a' | { read a b; printf '%s\n' "x${a}x${b}x"; }
+printf '%s\n' '\\\:a' | { IFS=: read a b; printf '%s\n' "x${a}x${b}x"; }
Copied: stable/8/tools/regression/bin/sh/builtins/read4.0.stdout (from r212339, head/tools/regression/bin/sh/builtins/read4.0.stdout)
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ stable/8/tools/regression/bin/sh/builtins/read4.0.stdout Thu Sep 23 21:36:10 2010 (r213087, copy of r212339, head/tools/regression/bin/sh/builtins/read4.0.stdout)
@@ -0,0 +1,8 @@
+xa bxcx
+xaxb cx
+xa:bxcx
+xaxb:cx
+x\xax
+x\xax
+x\ axx
+x\:axx
More information about the svn-src-all
mailing list