]> sourceware.org Git - newlib-cygwin.git/commitdiff
2008-02-12 Peter Rosin <peda@lysator.liu.se>
authorJeff Johnston <jjohnstn@redhat.com>
Tue, 12 Feb 2008 17:20:09 +0000 (17:20 +0000)
committerJeff Johnston <jjohnstn@redhat.com>
Tue, 12 Feb 2008 17:20:09 +0000 (17:20 +0000)
        * libc/stdlib/getopt.c (getopt_internal): Handle optional
        arguments better for long options and short options not
        appearing as the first option in a sequence.

newlib/ChangeLog
newlib/libc/stdlib/getopt.c

index b20a7ad1cc5a64239092fd801edbeb6091209c8b..bf077bf62c9603e94260769aa9647116ca525fd4 100644 (file)
@@ -1,3 +1,9 @@
+2008-02-12  Peter Rosin  <peda@lysator.liu.se>
+
+       * libc/stdlib/getopt.c (getopt_internal): Handle optional
+       arguments better for long options and short options not
+       appearing as the first option in a sequence.
+
 2008-02-11  Patrick Mansfield  <patmans@us.ibm.com>
 
        * libc/machine/spu/straddr.h: New file, supplies _straddr.
index 06e3781709d9426b9fdd49e42c407e10fd406415..09952db19c1799c86e9da31c58c3182e88233f9d 100644 (file)
@@ -308,13 +308,8 @@ getopt_internal (int argc, char *const argv[], const char *shortopts,
     case OPTIONAL_ARG:
       if (*possible_arg == '=')
         possible_arg++;
-      if (*possible_arg != '\0')
-        {
-          optarg = possible_arg;
-          optwhere = 1;
-        }
-      else
-        optarg = NULL;
+      optarg = (*possible_arg != '\0') ? possible_arg : NULL;
+      optwhere = 1;
       break;
     case REQUIRED_ARG:
       if (*possible_arg == '=')
This page took 0.04801 seconds and 5 git commands to generate.