#include "bashintl.h"
#include "shell.h"
+#include "execute_cmd.h"
#include "flags.h"
#include "input.h"
extern int executing_line_number __P((void));
-extern int last_command_exit_value;
-extern char *shell_name;
#if defined (JOB_CONTROL)
extern pid_t shell_pgrp;
extern int give_terminal_to __P((pid_t, int));
va_end (args);
}
+void
+#if defined (PREFER_STDARG)
+internal_inform (const char *format, ...)
+#else
+internal_inform (format, va_alist)
+ const char *format;
+ va_dcl
+#endif
+{
+ va_list args;
+
+ error_prolog (1);
+ /* TRANSLATORS: this is a prefix for informational messages. */
+ fprintf (stderr, _("INFORM: "));
+
+ SH_VA_START (args, format);
+
+ vfprintf (stderr, format, args);
+ fprintf (stderr, "\n");
+
+ va_end (args);
+}
+
void
#if defined (PREFER_STDARG)
sys_error (const char *format, ...)
}
#ifdef DEBUG
+/* This assumes ASCII and is suitable only for debugging */
+char *
+strescape (str)
+ const char *str;
+{
+ char *r, *result;
+ unsigned char *s;
+
+ r = result = (char *)xmalloc (strlen (str) * 2 + 1);
+
+ for (s = (unsigned char *)str; s && *s; s++)
+ {
+ if (*s < ' ')
+ {
+ *r++ = '^';
+ *r++ = *s+64;
+ }
+ else if (*s == 127)
+ {
+ *r++ = '^';
+ *r++ = '?';
+ }
+ else
+ *r++ = *s;
+ }
+
+ *r = '\0';
+ return result;
+}
+
void
#if defined (PREFER_STDARG)
itrace (const char *format, ...)