From 2b85678c578cb22d15d449ab70872d3b6b6b9364 Mon Sep 17 00:00:00 2001 From: P. J. McDermott Date: Sun, 21 Feb 2016 03:21:31 -0500 Subject: Don't loop forever on unterminated singly quoted string in words --- diff --git a/parsing/lexer.sh b/parsing/lexer.sh index 53af926..292d2fa 100644 --- a/parsing/lexer.sh +++ b/parsing/lexer.sh @@ -451,9 +451,15 @@ scan_word() while :; do lgetc word="${word}${c}" - case "${c}" in \') - break - ;; + case "${c}" in + '') + synerr '%s %s' \ + 'Unterminated' \ + 'quoted string' + ;; + \') + break + ;; esac done ;; diff --git a/parsing/parse.sh b/parsing/parse.sh index c9e8000..dd340bd 100644 --- a/parsing/parse.sh +++ b/parsing/parse.sh @@ -665,7 +665,8 @@ try() #try 'foo <<\EOF' '$(bar)' 'EOF' #try 'foo <