[bug #58075] compiler warning: add explicit braces to avoid dangling else

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

[bug #58075] compiler warning: add explicit braces to avoid dangling else

anonymous
URL:
  <https://savannah.gnu.org/bugs/?58075>

                 Summary: compiler warning: add explicit braces to avoid
dangling else
                 Project: make
            Submitted by: None
            Submitted on: Sun 29 Mar 2020 01:35:17 PM UTC
                Severity: 3 - Normal
              Item Group: Build/Install
                  Status: None
                 Privacy: Public
             Assigned to: None
             Open/Closed: Open
         Discussion Lock: Any
       Component Version: 4.3
        Operating System: POSIX-Based
           Fixed Release: None
           Triage Status: None

    _______________________________________________________

Details:

Hopefully someone can make this update

diff --git a/src/getopt.c b/src/getopt.c
index 35e71ef..e0647ae 100644
--- a/src/getopt.c
+++ b/src/getopt.c
@@ -677,6 +677,7 @@ _getopt_internal (int argc, char *const *argv, const char
*optstring,
              else
                {
                  if (opterr)
+                  {
                   if (argv[optind - 1][1] == '-')
                    /* --option */
                    fprintf (stderr,
@@ -687,6 +688,7 @@ _getopt_internal (int argc, char *const *argv, const char
*optstring,
                    fprintf (stderr,
                     _("%s: option '%c%s' doesn't allow an argument\n"),
                     argv[0], argv[optind - 1][0], pfound->name);
+                  }
 
                  nextchar += strlen (nextchar);
 





    _______________________________________________________

Reply to this item at:

  <https://savannah.gnu.org/bugs/?58075>

_______________________________________________
  Message sent via Savannah
  https://savannah.gnu.org/