summaryrefslogtreecommitdiffstats
path: root/bin/sh/input.h
diff options
context:
space:
mode:
authorjilles <jilles@FreeBSD.org>2009-11-22 14:04:20 +0000
committerjilles <jilles@FreeBSD.org>2009-11-22 14:04:20 +0000
commit20812b17e03ee11696a188bf6ff7052d42c72df8 (patch)
tree0ba1f228ffeefae0838e106fccaf6a76f2040cce /bin/sh/input.h
parent9b1c5e3514335e3055a2653349323a1a8a9220c0 (diff)
downloadFreeBSD-src-20812b17e03ee11696a188bf6ff7052d42c72df8.zip
FreeBSD-src-20812b17e03ee11696a188bf6ff7052d42c72df8.tar.gz
sh: Ensure the same command input file is on top after executing a builtin.
This avoids weirdness when 'fc -e vi' or the like is done and there is a syntax error in the file. Formerly an interactive shell tried to execute stuff after the syntax error and exited. This should also avoid similar issues with 'command eval' and 'command .' when 'command' is implemented properly as in NetBSD sh. Special builtins did not have this problem since errors in them cause the shell to exit or to reset various state such as the current command input file.
Diffstat (limited to 'bin/sh/input.h')
-rw-r--r--bin/sh/input.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/bin/sh/input.h b/bin/sh/input.h
index 4d57b3b..067d011 100644
--- a/bin/sh/input.h
+++ b/bin/sh/input.h
@@ -45,6 +45,8 @@ extern int parsenleft; /* number of characters left in input buffer */
extern char *parsenextc; /* next character in input buffer */
extern int init_editline; /* 0 == not setup, 1 == OK, -1 == failed */
+struct parsefile;
+
char *pfgets(char *, int);
int pgetc(void);
int preadbuffer(void);
@@ -56,6 +58,8 @@ void setinputfile(char *, int);
void setinputfd(int, int);
void setinputstring(char *, int);
void popfile(void);
+struct parsefile *getcurrentfile(void);
+void popfilesupto(struct parsefile *);
void popallfiles(void);
void closescript(void);
OpenPOWER on IntegriCloud