summary refs log tree commit diff
path: root/src/input.c
diff options
context:
space:
mode:
authorHerbert Xu <herbert@gondor.apana.org.au>2018-03-27 00:39:35 +0800
committerHerbert Xu <herbert@gondor.apana.org.au>2018-04-19 18:19:29 +0800
commit46d5a7fcea81b489819f753451c1ad2fe435f148 (patch)
tree815be18bb4833adef40246c99a4be0a9cd762fd4 /src/input.c
parenteval: Reap zombies after built-in commands and functions (diff)
downloaddash-46d5a7fcea81b489819f753451c1ad2fe435f148.tar.gz
dash-46d5a7fcea81b489819f753451c1ad2fe435f148.zip
eval: Restore input files in evalcommand
When evalcommand invokes a command that modifies parsefile and
then bails out without popping the file, we need to ensure the
input file is restored so that the shell can continue to execute.

Reported-by: Martijn Dekker <martijn@inlv.org>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Diffstat (limited to 'src/input.c')
-rw-r--r--src/input.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/input.c b/src/input.c
index e53423c..ae0c4c8 100644
--- a/src/input.c
+++ b/src/input.c
@@ -479,6 +479,13 @@ popfile(void)
 }
 
 
+void unwindfiles(struct parsefile *stop)
+{
+	while (parsefile != stop)
+		popfile();
+}
+
+
 /*
  * Return to top level.
  */
@@ -486,8 +493,7 @@ popfile(void)
 void
 popallfiles(void)
 {
-	while (parsefile != &basepf)
-		popfile();
+	unwindfiles(&basepf);
 }
 
 
;follow=1'>Rewrite UI againJune McEnroe The persistent topic is gone and the status line is now at the top. The status formatting still needs to be reworked. I also want to try showing the nick in the input window so it really looks like your next message. 2018-09-12Add note about C-oJune McEnroe Why are there so few well usable ctrl key bindings? 2018-09-12Use formatParse split to position input cursorJune McEnroe 2018-09-12Factor out IRC formatting parsingJune McEnroe 2018-09-11Add /help equivalent to /manJune McEnroe 2018-09-11Don't render every PM as a pingJune McEnroe 2018-09-11Add urlOpenMatchJune McEnroe 2018-09-10Depend on man.sh for chroot.tar targetJune McEnroe 2018-09-10Set LESSSECURE=1 in man.shJune McEnroe Ridiculous. 2018-09-10Add /man commandJune McEnroe 2018-09-10Install man page in chrootJune McEnroe 2018-09-10Install man pageJune McEnroe 2018-09-10Split keys into subsections and document colorsJune McEnroe 2018-09-10Add "blank" lines to chatte.1June McEnroe 2018-09-10Document key bindings in chatte.1June McEnroe 2018-09-08Document slash commands in chatte.1June McEnroe