From d70eb3def648005ae523f4fa7f2c5813365b2232 Mon Sep 17 00:00:00 2001 From: P. J. McDermott Date: Sat, 20 Feb 2016 20:20:23 -0500 Subject: scan_wordexp(): Catch and rethrow some uncaught exceptions --- (limited to 'parsing') diff --git a/parsing/lexer.sh b/parsing/lexer.sh index a7fbb80..ad076dc 100644 --- a/parsing/lexer.sh +++ b/parsing/lexer.sh @@ -349,7 +349,10 @@ scan_wordexp() [@*#?$!A-Za-z0-9_-]) # String length # expansion - res="$(scan_param)" + if ! res="$(scan_param)" + then + exit 1 + fi ln_off=${res%%${RS}*} res="${res#*${RS}}" c="${res%%${RS}*}" @@ -422,7 +425,9 @@ scan_wordexp() fi if ${mod}; then # Get word. - res="$(scan_word true)" + if ! res="$(scan_word true)"; then + exit 1 + fi ln_off=${res%%${RS}*} res="${res#*${RS}}" c="${res%%${RS}*}" @@ -474,7 +479,9 @@ scan_wordexp() esac ;; [@*#?$!A-Za-z0-9_-]) - res="$(scan_param)" + if ! res="$(scan_param)"; then + exit 1 + fi ln_off=${res%%${RS}*} res="${res#*${RS}}" c="${res%%${RS}*}" -- cgit v0.9.1