Formerly main.c.~42~
authorRoland McGrath <roland@redhat.com>
Mon, 11 May 1992 18:11:40 +0000 (18:11 +0000)
committerRoland McGrath <roland@redhat.com>
Mon, 11 May 1992 18:11:40 +0000 (18:11 +0000)
main.c

diff --git a/main.c b/main.c
index b2dcff0..6fb188a 100644 (file)
--- a/main.c
+++ b/main.c
@@ -1037,7 +1037,8 @@ decode_switches (argc, argv)
   *p++ = '-';                  /* Non-option args are returned in order.  */
   for (i = 0; switches[i].c != '\0'; ++i)
     {
-      long_options[i].name = switches[i].long_name;
+      long_options[i].name = (switches[i].long_name == 0 ? "" :
+                             switches[i].long_name);
       *p++ = switches[i].c;
       switch (switches[i].type)
        {
@@ -1091,8 +1092,8 @@ decode_switches (argc, argv)
        }
       else
        for (cs = switches; cs->c != '\0'; ++cs)
-         {
-           if (cs->c == c)
+         if (cs->c == c)
+           {
              switch (cs->type)
                {
                default:
@@ -1158,9 +1159,9 @@ positive integral argument",
                  break;
                }
            
-           /* We've found the switch.  Stop looking.  */
-           break;
-         }
+             /* We've found the switch.  Stop looking.  */
+             break;
+           }
     }
 
   if (other_args != 0)