2
0
mirror of git://sourceware.org/git/glibc.git synced 2025-04-24 14:41:06 +08:00

Don't skip error checking when being quiet.

This commit is contained in:
Ulrich Drepper 1998-03-02 13:35:00 +00:00
parent a235a58c79
commit a4838496a6
3 changed files with 64 additions and 47 deletions

@ -129,9 +129,12 @@ monetary_finish (struct localedef_t *locale)
/* The international currency symbol must come from ISO 4217. */
if (monetary->int_curr_symbol != NULL)
{
if (strlen (monetary->int_curr_symbol) != 4 && !be_quiet)
error (0, 0, _("\
if (strlen (monetary->int_curr_symbol) != 4)
{
if (!be_quiet)
error (0, 0, _("\
value of field `int_curr_symbol' in category `LC_MONETARY' has wrong length"));
}
else if (bsearch (monetary->int_curr_symbol, valid_int_curr,
NR_VALID_INT_CURR, sizeof (const char *),
(comparison_fn_t) curr_strcmp) == NULL

@ -149,21 +149,23 @@ time_finish (struct localedef_t *locale)
memcpy (str, time->era[idx], era_len + 1);
/* First character must be + or - for the direction. */
if (*str != '+' && *str != '-' && !be_quiet)
if (*str != '+' && *str != '-')
{
error (0, 0, _("direction flag in string %d in `era' field"
" in category `%s' is not '+' nor '-'"),
idx + 1, "LC_TIME");
if (!be_quiet)
error (0, 0, _("direction flag in string %d in `era' field"
" in category `%s' is not '+' nor '-'"),
idx + 1, "LC_TIME");
/* Default arbitrarily to '+'. */
time->era_entries[idx].direction = '+';
}
else
time->era_entries[idx].direction = *str;
if (*++str != ':' && !be_quiet)
if (*++str != ':')
{
error (0, 0, _("direction flag in string %d in `era' field"
" in category `%s' is not a single character"),
idx + 1, "LC_TIME");
if (!be_quiet)
error (0, 0, _("direction flag in string %d in `era' field"
" in category `%s' is not a single character"),
idx + 1, "LC_TIME");
(void) strsep (&str, ":");
}
else
@ -171,18 +173,20 @@ time_finish (struct localedef_t *locale)
/* Now the offset year. */
time->era_entries[idx].offset = strtol (str, &endp, 10);
if (endp == str && !be_quiet)
if (endp == str)
{
error (0, 0, _("illegal number for offset in string %d in"
" `era' field in category `%s'"),
idx + 1, "LC_TIME");
if (!be_quiet)
error (0, 0, _("illegal number for offset in string %d in"
" `era' field in category `%s'"),
idx + 1, "LC_TIME");
(void) strsep (&str, ":");
}
else if (*endp != ':' && !be_quiet)
else if (*endp != ':')
{
error (0, 0, _("garbage at end of offset value in string %d in"
" `era' field in category `%s'"),
idx + 1, "LC_TIME");
if (!be_quiet)
error (0, 0, _("garbage at end of offset value in string %d in"
" `era' field in category `%s'"),
idx + 1, "LC_TIME");
(void) strsep (&str, ":");
}
else
@ -224,20 +228,23 @@ time_finish (struct localedef_t *locale)
time->era_entries[idx].start_date[1] -= 1;
time->era_entries[idx].start_date[2] = strtol (str, &endp, 10);
if (endp == str && !be_quiet)
if (endp == str)
{
invalid_start_date:
error (0, 0, _("illegal starting date in string %d in"
" `era' field in category `%s'"),
idx + 1, "LC_TIME");
if (!be_quiet)
error (0, 0, _("illegal starting date in string %d in"
" `era' field in category `%s'"),
idx + 1, "LC_TIME");
(void) strsep (&str, ":");
}
else if (*endp != ':' && !be_quiet)
else if (*endp != ':')
{
garbage_start_date:
error (0, 0, _("garbage at end of starting date in string %d"
" in `era' field in category `%s'"),
idx + 1, "LC_TIME");
if (!be_quiet)
error (0, 0, _("garbage at end of starting date "
"in string %d in `era' field "
"in category `%s'"),
idx + 1, "LC_TIME");
(void) strsep (&str, ":");
}
else
@ -297,20 +304,23 @@ time_finish (struct localedef_t *locale)
time->era_entries[idx].stop_date[1] -= 1;
time->era_entries[idx].stop_date[2] = strtol (str, &endp, 10);
if (endp == str && !be_quiet)
if (endp == str)
{
invalid_stop_date:
error (0, 0, _("illegal stopping date in string %d in"
" `era' field in category `%s'"),
idx + 1, "LC_TIME");
if (!be_quiet)
error (0, 0, _("illegal stopping date in string %d in"
" `era' field in category `%s'"),
idx + 1, "LC_TIME");
(void) strsep (&str, ":");
}
else if (*endp != ':' && !be_quiet)
else if (*endp != ':')
{
garbage_stop_date:
error (0, 0, _("garbage at end of stopping date in string %d"
" in `era' field in category `%s'"),
idx + 1, "LC_TIME");
if (!be_quiet)
error (0, 0, _("garbage at end of stopping date "
"in string %d in `era' field "
"in category `%s'"),
idx + 1, "LC_TIME");
(void) strsep (&str, ":");
}
else
@ -334,10 +344,11 @@ time_finish (struct localedef_t *locale)
}
}
if ((str == NULL || *str == '\0') && !be_quiet)
if ((str == NULL || *str == '\0'))
{
error (0, 0, _("missing era name in string %d in `era' field"
" in category `%s'"), idx + 1, "LC_TIME");
if (!be_quiet)
error (0, 0, _("missing era name in string %d in `era' field"
" in category `%s'"), idx + 1, "LC_TIME");
time->era_entries[idx].name =
time->era_entries[idx].format = "";
}
@ -345,11 +356,12 @@ time_finish (struct localedef_t *locale)
{
time->era_entries[idx].name = strsep (&str, ":");
if ((str == NULL || *str == '\0') && !be_quiet)
if ((str == NULL || *str == '\0'))
{
error (0, 0, _("missing era format in string %d in `era'"
" field in category `%s'"),
idx + 1, "LC_TIME");
if (!be_quiet)
error (0, 0, _("missing era format in string %d in `era'"
" field in category `%s'"),
idx + 1, "LC_TIME");
time->era_entries[idx].name =
time->era_entries[idx].format = "";
}

@ -1015,11 +1015,12 @@ write_locale_data (const char *output_path, const char *category,
save_err = errno;
}
if (fd == -1 && !be_quiet)
if (fd == -1)
{
error (0, save_err, _("\
if (!be_quiet)
error (0, save_err, _("\
cannot open output file `%s' for category `%s'"),
fname, category);
fname, category);
return;
}
}
@ -1039,10 +1040,11 @@ cannot open output file `%s' for category `%s'"),
if (maxiov > 0)
step = MIN (maxiov, step);
if (writev (fd, &vec[cnt], step) < 0 && !be_quiet)
if (writev (fd, &vec[cnt], step) < 0)
{
error (0, errno, _("failure while writing data for category `%s'"),
category);
if (!be_quiet)
error (0, errno, _("failure while writing data for category `%s'"),
category);
break;
}
}