Print this page
5218 posix definition of NULL
correct unistd.h and iso/stddef_iso.h
update gate source affected

Split Close
Expand all
Collapse all
          --- old/usr/src/lib/libc/port/gen/getopt.c
          +++ new/usr/src/lib/libc/port/gen/getopt.c
↓ open down ↓ 191 lines elided ↑ open up ↑
 192  192           *      *argv[optind]   is not the character '-'
 193  193           *      argv[optind]    points to the string "-"
 194  194           * getopt() returns -1 without changing optind. If
 195  195           *      argv[optind]    points to the string "--"
 196  196           * getopt() returns -1 after incrementing optind.
 197  197           */
 198  198          if (_sp == 1) {
 199  199                  if (optind >= argc || argv[optind][0] != '-' ||
 200  200                      argv[optind] == NULL || argv[optind][1] == '\0')
 201  201                          return (EOF);
 202      -                else if (strcmp(argv[optind], "--") == NULL) {
      202 +                else if (strcmp(argv[optind], "--") == 0) {
 203  203                          optind++;
 204  204                          return (EOF);
 205  205                  }
 206  206          }
 207  207  
 208  208          /*
 209  209           * Getting this far indicates that an option has been encountered.
 210  210           * Note that the syntax of optstring applies special meanings to
 211  211           * the characters ':' and '(', so they are not permissible as
 212  212           * option letters. A special meaning is also applied to the ')'
↓ open down ↓ 97 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX