]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
Don't skip error checking when being quiet.
authorUlrich Drepper <drepper@redhat.com>
Mon, 2 Mar 1998 13:35:00 +0000 (13:35 +0000)
committerUlrich Drepper <drepper@redhat.com>
Mon, 2 Mar 1998 13:35:00 +0000 (13:35 +0000)
locale/programs/ld-monetary.c
locale/programs/ld-time.c
locale/programs/locfile.c

index 2c5bb7385dfa6dcc1c506a31304a6e79176c09ae..46a21aa559341ea86268b81483d775e98545e38d 100644 (file)
@@ -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
index 31ff6ffe8587384b22ec1fff1960da5e492c52c9..54e7c9410a6f20cb2d71103987cc0a42344e3d07 100644 (file)
@@ -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 = "";
                }
index 7749f6aebc15df14b6e3bc03e19a7c8547eaff58..442535c2a6a2f1109569dd573463ff9f39dc15b9 100644 (file)
@@ -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;
        }
     }