X-Git-Url: https://git.deb.at/w?a=blobdiff_plain;f=getopt.c;h=0a24ce5ea69455cae1424b91bbc783924e21c260;hb=5840fceb1f91b066a4c4361b0599c417aa111386;hp=0f41fb692366816f1ac535b714c75cbca4ff9a8f;hpb=3cea3c8809447c5d6658671b78b9af7137fd9b0d;p=pkg%2Fabook.git diff --git a/getopt.c b/getopt.c index 0f41fb6..0a24ce5 100644 --- a/getopt.c +++ b/getopt.c @@ -23,7 +23,7 @@ License along with the GNU C Library; see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ - + /* This tells Alpha OSF/1 not to define a getopt prototype in . Ditto for AIX 3.2 and . */ #ifndef _NO_PROTO @@ -43,6 +43,7 @@ #endif #include +#include /* Comment out all this code if we are using the GNU C Library, and are not actually compiling the library itself. This code is part of the GNU C @@ -197,7 +198,7 @@ ordering; /* Value of POSIXLY_CORRECT environment variable. */ static char *posixly_correct; - + #ifdef __GNU_LIBRARY__ /* We want to avoid inclusion of string.h with non-GNU libraries because there are many ways it can cause trouble. @@ -240,7 +241,7 @@ extern int strlen(const char *); #endif /* __GNUC__ */ #endif /* not __GNU_LIBRARY__ */ - + /* Handle permutation of arguments. */ /* Describe the part of ARGV that contains non-options that have @@ -407,7 +408,7 @@ static const char * return optstring; } - + /* Scan elements of ARGV (whose length is ARGC) for option characters given in OPTSTRING. @@ -650,6 +651,7 @@ int else { if (opterr) + { if (argv[optind - 1][1] == '-') /* --option */ fprintf(stderr, @@ -660,6 +662,7 @@ int fprintf(stderr, _("%s: option `%c%s' doesn't allow an argument\n"), argv[0], argv[optind - 1][0], pfound->name); + } nextchar += strlen(nextchar); @@ -930,7 +933,7 @@ int } #endif /* Not ELIDE_CODE. */ - + #ifdef TEST /* Compile with -DTEST to make an executable for use in testing