aboutsummaryrefslogtreecommitdiffstats
path: root/builtins/evalfile.c
diff options
context:
space:
mode:
Diffstat (limited to 'builtins/evalfile.c')
-rw-r--r--builtins/evalfile.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/builtins/evalfile.c b/builtins/evalfile.c
index 972d039..4d69acb 100644
--- a/builtins/evalfile.c
+++ b/builtins/evalfile.c
@@ -70,6 +70,7 @@ extern int posixly_correct;
extern int indirection_level, subshell_environment;
extern int return_catch_flag, return_catch_value;
extern int last_command_exit_value;
+extern int executing_command_builtin;
/* How many `levels' of sourced files we have. */
int sourcelevel = 0;
@@ -148,10 +149,6 @@ file_error_and_exit:
return ((flags & FEVAL_BUILTIN) ? EXECUTION_FAILURE : -1);
}
-#if defined (__CYGWIN__) && defined (O_TEXT)
- setmode (fd, O_TEXT);
-#endif
-
if (S_ISREG (finfo.st_mode) && file_size <= SSIZE_MAX)
{
string = (char *)xmalloc (1 + file_size);
@@ -342,7 +339,7 @@ source_file (filename, sflags)
if (sflags)
flags |= FEVAL_NOPUSHARGS;
/* POSIX shells exit if non-interactive and file error. */
- if (posixly_correct && !interactive_shell)
+ if (posixly_correct && interactive_shell == 0 && executing_command_builtin == 0)
flags |= FEVAL_LONGJMP;
rval = _evalfile (filename, flags);