mirror of
https://https.git.savannah.gnu.org/git/bash.git
synced 2026-08-06 10:12:38 +02:00
commit bash-20040107 snapshot
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
/* error.c -- Functions for handling errors. */
|
||||
/* Copyright (C) 1993 Free Software Foundation, Inc.
|
||||
/* Copyright (C) 1993-2003 Free Software Foundation, Inc.
|
||||
|
||||
This file is part of GNU Bash, the Bourne Again SHell.
|
||||
|
||||
@@ -40,6 +40,8 @@ extern int errno;
|
||||
#endif /* !errno */
|
||||
|
||||
#include "bashansi.h"
|
||||
#include "bashintl.h"
|
||||
|
||||
#include "shell.h"
|
||||
#include "flags.h"
|
||||
#include "input.h"
|
||||
@@ -58,6 +60,10 @@ extern pid_t shell_pgrp;
|
||||
extern int give_terminal_to __P((pid_t, int));
|
||||
#endif /* JOB_CONTROL */
|
||||
|
||||
#if defined (ARRAY_VARS)
|
||||
extern char *bash_badsub_errmsg;
|
||||
#endif
|
||||
|
||||
static void error_prolog __P((int));
|
||||
|
||||
/* The current maintainer of the shell. You change this in the
|
||||
@@ -156,7 +162,7 @@ programming_error (format, va_alist)
|
||||
if (remember_on_history)
|
||||
{
|
||||
h = last_history_line ();
|
||||
fprintf (stderr, "last command: %s\n", h ? h : "(null)");
|
||||
fprintf (stderr, _("last command: %s\n"), h ? h : "(null)");
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -164,7 +170,7 @@ programming_error (format, va_alist)
|
||||
fprintf (stderr, "Report this to %s\n", the_current_maintainer);
|
||||
#endif
|
||||
|
||||
fprintf (stderr, "Stopping myself...");
|
||||
fprintf (stderr, _("Aborting..."));
|
||||
fflush (stderr);
|
||||
|
||||
abort ();
|
||||
@@ -194,7 +200,7 @@ report_error (format, va_alist)
|
||||
|
||||
va_end (args);
|
||||
if (exit_immediately_on_error)
|
||||
sh_exit (1);
|
||||
exit_shell (1);
|
||||
}
|
||||
|
||||
void
|
||||
@@ -251,7 +257,7 @@ internal_warning (format, va_alist)
|
||||
{
|
||||
va_list args;
|
||||
|
||||
fprintf (stderr, "%s: warning: ", get_name_for_error ());
|
||||
fprintf (stderr, _("%s: warning: "), get_name_for_error ());
|
||||
|
||||
SH_VA_START (args, format);
|
||||
|
||||
@@ -325,7 +331,7 @@ parser_error (lineno, format, va_alist)
|
||||
va_end (args);
|
||||
|
||||
if (exit_immediately_on_error)
|
||||
sh_exit (2);
|
||||
exit_shell (2);
|
||||
}
|
||||
|
||||
#ifdef DEBUG
|
||||
@@ -396,10 +402,10 @@ trace (format, va_alist)
|
||||
|
||||
|
||||
static char *cmd_error_table[] = {
|
||||
"unknown command error", /* CMDERR_DEFAULT */
|
||||
"bad command type", /* CMDERR_BADTYPE */
|
||||
"bad connector", /* CMDERR_BADCONN */
|
||||
"bad jump", /* CMDERR_BADJUMP */
|
||||
N_("unknown command error"), /* CMDERR_DEFAULT */
|
||||
N_("bad command type"), /* CMDERR_BADTYPE */
|
||||
N_("bad connector"), /* CMDERR_BADCONN */
|
||||
N_("bad jump"), /* CMDERR_BADJUMP */
|
||||
0
|
||||
};
|
||||
|
||||
@@ -411,7 +417,7 @@ command_error (func, code, e, flags)
|
||||
if (code > CMDERR_LAST)
|
||||
code = CMDERR_DEFAULT;
|
||||
|
||||
programming_error ("%s: %s: %d", func, cmd_error_table[code], e);
|
||||
programming_error ("%s: %s: %d", func, _(cmd_error_table[code]), e);
|
||||
}
|
||||
|
||||
char *
|
||||
@@ -421,7 +427,7 @@ command_errstr (code)
|
||||
if (code > CMDERR_LAST)
|
||||
code = CMDERR_DEFAULT;
|
||||
|
||||
return (cmd_error_table[code]);
|
||||
return (_(cmd_error_table[code]));
|
||||
}
|
||||
|
||||
#ifdef ARRAY_VARS
|
||||
@@ -429,7 +435,7 @@ void
|
||||
err_badarraysub (s)
|
||||
const char *s;
|
||||
{
|
||||
report_error ("%s: bad array subscript", s);
|
||||
report_error ("%s: %s", s, _(bash_badsub_errmsg));
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -437,12 +443,12 @@ void
|
||||
err_unboundvar (s)
|
||||
const char *s;
|
||||
{
|
||||
report_error ("%s: unbound variable", s);
|
||||
report_error (_("%s: unbound variable"), s);
|
||||
}
|
||||
|
||||
void
|
||||
err_readonly (s)
|
||||
const char *s;
|
||||
{
|
||||
report_error ("%s: readonly variable", s);
|
||||
report_error (_("%s: readonly variable"), s);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user