Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 14 Aug 2013 19:34:13 +0000 (UTC)
From:      Jilles Tjoelker <jilles@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r254335 - in head: bin/sh tools/regression/bin/sh/parser
Message-ID:  <201308141934.r7EJYDvl002507@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: jilles
Date: Wed Aug 14 19:34:13 2013
New Revision: 254335
URL: http://svnweb.freebsd.org/changeset/base/254335

Log:
  sh: Allow a lone redirection before '|', ';;' or ';&'.
  
  Example: </dev/null | :
  
  PR:		181240
  MFC after:	1 week

Added:
  head/tools/regression/bin/sh/parser/only-redir2.0   (contents, props changed)
  head/tools/regression/bin/sh/parser/only-redir3.0   (contents, props changed)
  head/tools/regression/bin/sh/parser/only-redir4.0   (contents, props changed)
Modified:
  head/bin/sh/parser.c

Modified: head/bin/sh/parser.c
==============================================================================
--- head/bin/sh/parser.c	Wed Aug 14 19:16:37 2013	(r254334)
+++ head/bin/sh/parser.c	Wed Aug 14 19:34:13 2013	(r254335)
@@ -577,6 +577,9 @@ TRACE(("expecting DO got %s %s\n", tokna
 	case TSEMI:
 	case TAND:
 	case TOR:
+	case TPIPE:
+	case TENDCASE:
+	case TFALLTHRU:
 		/*
 		 * An empty command before a ; doesn't make much sense, and
 		 * should certainly be disallowed in the case of `if ;'.

Added: head/tools/regression/bin/sh/parser/only-redir2.0
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/tools/regression/bin/sh/parser/only-redir2.0	Wed Aug 14 19:34:13 2013	(r254335)
@@ -0,0 +1,2 @@
+# $FreeBSD$
+</dev/null | :

Added: head/tools/regression/bin/sh/parser/only-redir3.0
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/tools/regression/bin/sh/parser/only-redir3.0	Wed Aug 14 19:34:13 2013	(r254335)
@@ -0,0 +1,2 @@
+# $FreeBSD$
+case x in x) </dev/null ;; esac

Added: head/tools/regression/bin/sh/parser/only-redir4.0
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/tools/regression/bin/sh/parser/only-redir4.0	Wed Aug 14 19:34:13 2013	(r254335)
@@ -0,0 +1,2 @@
+# $FreeBSD$
+case x in x) </dev/null ;& esac



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201308141934.r7EJYDvl002507>