Be kind to translators, save some useless translations.

* main.c (banner): New function.
(fatal_banner): Use it.
(warn_banner): Use it.
This commit is contained in:
Akim Demaille
2000-03-17 13:02:28 +00:00
parent ae3c316400
commit e87b57008e
2 changed files with 36 additions and 22 deletions

View File

@@ -1,3 +1,11 @@
2000-03-17 Akim Demaille <akim@epita.fr>
Be kind to translators, save some useless translations.
* main.c (banner): New function.
(fatal_banner): Use it.
(warn_banner): Use it.
2000-03-17 Akim Demaille <akim@epita.fr>
* reader.c (copy_definition): Use copy_string and copy_comment.

View File

@@ -1,5 +1,5 @@
/* Top level entry point of bison,
Copyright (C) 1984, 1986, 1989, 1992, 1995 Free Software Foundation, Inc.
Copyright (C) 1984, 1986, 1989, 1992, 1995, 2000 Free Software Foundation, Inc.
This file is part of Bison, the GNU Compiler Compiler.
@@ -145,13 +145,22 @@ int_to_string (int i)
return buf;
}
/* Display filename and lino if available. */
static void
banner (void)
{
if (infile == 0)
fprintf(stderr, "%s: ", program_name);
else
fprintf(stderr, "%s:%d: ", infile, lineno);
}
static void
fatal_banner (void)
{
if (infile == 0)
fprintf(stderr, _("%s: fatal error: "), program_name);
else
fprintf(stderr, _("%s:%d: fatal error: "), infile, lineno);
banner ();
fputs (_("fatal error: "), stderr);
}
/* Print the message S for a fatal error. */
@@ -181,10 +190,7 @@ fatals (char *fmt, char *x1)
static void
warn_banner (void)
{
if (infile == 0)
fprintf(stderr, _("%s: "), program_name);
else
fprintf(stderr, _("%s:%d: "), infile, lineno);
banner ();
failure = 1;
}