]> git.ipfire.org Git - thirdparty/bash.git/blobdiff - builtins/evalstring.c
bash-4.4 rc1 release
[thirdparty/bash.git] / builtins / evalstring.c
index b800da9e781a0f9d2c3ef6ed59d7946386d56992..f27d1b3b94caa2ac8651a3b5443d1f4f2c714a43 100644 (file)
@@ -168,8 +168,7 @@ parse_prologue (string, flags, tag)
   else
     unwind_protect_int (remember_on_history);  /* can be used in scripts */
 #  if defined (BANG_HISTORY)
-  if (interactive_shell)
-    unwind_protect_int (history_expansion_inhibited);
+  unwind_protect_int (history_expansion_inhibited);
 #  endif /* BANG_HISTORY */
 #endif /* HISTORY */
 
@@ -199,6 +198,10 @@ parse_prologue (string, flags, tag)
 #if defined (HISTORY)
   if (flags & SEVAL_NOHIST)
     bash_history_disable ();
+#  if defined (BANG_HISTORY)
+  if (flags & SEVAL_NOHISTEXP)
+    history_expansion_inhibited = 1;
+#  endif /* BANG_HISTORY */
 #endif /* HISTORY */
 }
 
@@ -211,6 +214,7 @@ parse_prologue (string, flags, tag)
        (flags & SEVAL_NOHIST) -> call bash_history_disable ()
        (flags & SEVAL_NOFREE) -> don't free STRING when finished
        (flags & SEVAL_RESETLINE) -> reset line_number to 1
+       (flags & SEVAL_NOHISTEXP) -> history_expansion_inhibited -> 1
 */
 
 int