summaryrefslogtreecommitdiffstats
path: root/parsing
diff options
context:
space:
mode:
authorP. J. McDermott <pj@pehjota.net>2016-02-20 20:20:23 (EST)
committer P. J. McDermott <pj@pehjota.net>2016-02-20 20:20:23 (EST)
commitd70eb3def648005ae523f4fa7f2c5813365b2232 (patch)
tree07d7ebf3c5d3f1138ebff58ee3d55fdea9f24e82 /parsing
parent0a72d231a7d42396e3551f38eb63d55fea100669 (diff)
downloadeggshell-d70eb3def648005ae523f4fa7f2c5813365b2232.zip
eggshell-d70eb3def648005ae523f4fa7f2c5813365b2232.tar.gz
eggshell-d70eb3def648005ae523f4fa7f2c5813365b2232.tar.bz2
scan_wordexp(): Catch and rethrow some uncaught exceptions
Diffstat (limited to 'parsing')
-rw-r--r--parsing/lexer.sh13
1 files changed, 10 insertions, 3 deletions
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}*}"