From 72348d41ba45ebcdac6d604fbf592f7c57aa4181 Mon Sep 17 00:00:00 2001 From: Joerg Wunsch Date: Fri, 11 Aug 1995 08:18:39 +0000 Subject: [PATCH] sh(1) incorrectly ignored an EOF condition when looking for the closing backquote in a `foo` substitution. Discovered by: Martin Welk --- bin/sh/parser.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/bin/sh/parser.c b/bin/sh/parser.c index 0952ea30767..1353b5be0a7 100644 --- a/bin/sh/parser.c +++ b/bin/sh/parser.c @@ -33,7 +33,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: parser.c,v 1.5 1995/01/11 07:07:00 paul Exp $ + * $Id: parser.c,v 1.6 1995/05/30 00:07:22 rgrimes Exp $ */ #ifndef lint @@ -1179,6 +1179,10 @@ parsebackq: { STARTSTACKSTR(out); while ((c = pgetc ()) != '`') { + if (c == PEOF) { + startlinno = plinno; + synerror("EOF in backquote substitution"); + } if (c == '\\') { c = pgetc (); if ( c != '\\' && c != '`' && c != '$'