|
|
462fb2 |
diff -up bash-4.2/builtins/evalfile.c.old bash-4.2/builtins/evalfile.c
|
|
|
462fb2 |
--- bash-4.2/builtins/evalfile.c.old 2015-05-14 20:45:31.402793505 +0200
|
|
|
462fb2 |
+++ bash-4.2/builtins/evalfile.c 2015-05-14 20:45:47.632794791 +0200
|
|
|
462fb2 |
@@ -317,6 +317,23 @@ maybe_execute_file (fname, force_noninte
|
|
|
462fb2 |
return result;
|
|
|
462fb2 |
}
|
|
|
462fb2 |
|
|
|
462fb2 |
+int
|
|
|
462fb2 |
+force_execute_file (fname, force_noninteractive)
|
|
|
462fb2 |
+ const char *fname;
|
|
|
462fb2 |
+ int force_noninteractive;
|
|
|
462fb2 |
+{
|
|
|
462fb2 |
+ char *filename;
|
|
|
462fb2 |
+ int result, flags;
|
|
|
462fb2 |
+
|
|
|
462fb2 |
+ filename = bash_tilde_expand (fname, 0);
|
|
|
462fb2 |
+ flags = 0;
|
|
|
462fb2 |
+ if (force_noninteractive)
|
|
|
462fb2 |
+ flags |= FEVAL_NONINT;
|
|
|
462fb2 |
+ result = _evalfile (filename, flags);
|
|
|
462fb2 |
+ free (filename);
|
|
|
462fb2 |
+ return result;
|
|
|
462fb2 |
+}
|
|
|
462fb2 |
+
|
|
|
462fb2 |
#if defined (HISTORY)
|
|
|
462fb2 |
int
|
|
|
462fb2 |
fc_execute_file (filename)
|
|
|
462fb2 |
diff -up bash-4.2/configure.in.old bash-4.2/configure.in
|
|
|
462fb2 |
--- bash-4.2/configure.in.old 2015-05-14 21:27:20.882449456 +0200
|
|
|
462fb2 |
+++ bash-4.2/configure.in 2015-05-14 21:19:25.654612738 +0200
|
|
|
462fb2 |
@@ -149,7 +149,7 @@ fi
|
|
|
462fb2 |
fi
|
|
|
462fb2 |
|
|
|
462fb2 |
if test -z "${DEBUGGER_START_FILE}"; then
|
|
|
462fb2 |
- DEBUGGER_START_FILE='${datadir}/bashdb/bashdb-main.inc'
|
|
|
462fb2 |
+ DEBUGGER_START_FILE='/usr/share/bashdb/bashdb-main.inc'
|
|
|
462fb2 |
fi
|
|
|
462fb2 |
|
|
|
462fb2 |
dnl optional shell features in config.h.in
|
|
|
462fb2 |
diff -up bash-4.2/shell.c.old bash-4.2/shell.c
|
|
|
462fb2 |
--- bash-4.2/shell.c.old 2015-05-14 20:42:54.379781066 +0200
|
|
|
462fb2 |
+++ bash-4.2/shell.c 2015-05-14 20:43:04.966781904 +0200
|
|
|
462fb2 |
@@ -1373,12 +1373,19 @@ start_debugger ()
|
|
|
462fb2 |
{
|
|
|
462fb2 |
#if defined (DEBUGGER) && defined (DEBUGGER_START_FILE)
|
|
|
462fb2 |
int old_errexit;
|
|
|
462fb2 |
+ int r;
|
|
|
462fb2 |
|
|
|
462fb2 |
old_errexit = exit_immediately_on_error;
|
|
|
462fb2 |
exit_immediately_on_error = 0;
|
|
|
462fb2 |
|
|
|
462fb2 |
- maybe_execute_file (DEBUGGER_START_FILE, 1);
|
|
|
462fb2 |
- function_trace_mode = 1;
|
|
|
462fb2 |
+ r = force_execute_file (DEBUGGER_START_FILE, 1);
|
|
|
462fb2 |
+ if (r < 0)
|
|
|
462fb2 |
+ {
|
|
|
462fb2 |
+ internal_warning ("cannot start debugger; debugging mode disabled");
|
|
|
462fb2 |
+ debugging_mode = function_trace_mode = 0;
|
|
|
462fb2 |
+ }
|
|
|
462fb2 |
+ else
|
|
|
462fb2 |
+ function_trace_mode = 1;
|
|
|
462fb2 |
|
|
|
462fb2 |
exit_immediately_on_error += old_errexit;
|
|
|
462fb2 |
#endif
|
|
|
462fb2 |
diff -up bash-4.2/builtins/evalfile.c.old bash-4.2/builtins/evalfile.c
|
|
|
462fb2 |
--- bash-4.2/builtins/evalfile.c.old 2015-05-15 00:52:01.357266353 +0200
|
|
|
462fb2 |
+++ bash-4.2/builtins/evalfile.c 2015-05-15 00:52:08.734263236 +0200
|
|
|
462fb2 |
@@ -125,7 +125,7 @@ file_error_and_exit:
|
|
|
462fb2 |
}
|
|
|
462fb2 |
|
|
|
462fb2 |
return ((flags & FEVAL_BUILTIN) ? EXECUTION_FAILURE
|
|
|
462fb2 |
- : ((errno == ENOENT) ? 0 : -1));
|
|
|
462fb2 |
+ : ((errno == ENOENT && (flags & FEVAL_ENOENTOK) != 0) ? 0 : -1));
|
|
|
462fb2 |
}
|
|
|
462fb2 |
|
|
|
462fb2 |
errfunc = ((flags & FEVAL_BUILTIN) ? builtin_error : internal_error);
|
|
|
462fb2 |
diff -up bash-4.2/builtins/common.h.old bash-4.2/builtins/common.h
|
|
|
462fb2 |
--- bash-4.2/builtins/common.h.old 2015-05-15 00:52:01.357266353 +0200
|
|
|
462fb2 |
+++ bash-4.2/builtins/common.h 2015-05-15 00:52:08.734263236 +0200
|
|
|
462fb2 |
@@ -170,6 +170,7 @@
|
|
|
462fb2 |
|
|
|
462fb2 |
/* Functions from evalfile.c */
|
|
|
462fb2 |
extern int maybe_execute_file __P((const char *, int));
|
|
|
462fb2 |
+extern int force_execute_file __P((const char *, int));
|
|
|
462fb2 |
extern int source_file __P((const char *, int));
|
|
|
462fb2 |
extern int fc_execute_file __P((const char *));
|
|
|
462fb2 |
|