rcolebaugh / rpms / bash

Forked from rpms/bash a year ago
Clone

Blame SOURCES/bash-4.2-check-debugger.patch

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