1
0
mirror of https://github.com/adtools/clib2.git synced 2025-12-08 14:59:05 +00:00

Fixed a bug in getopt_long

git-svn-id: file:///Users/olsen/Code/migration-svn-zu-git/logical-line-staging/clib2/trunk@14997 87f5fb63-7c3d-0410-a384-fd976d0f7a62
This commit is contained in:
Thomas Frieden
2005-06-26 12:01:50 +00:00
parent 039c805161
commit 2bdd055f4b

View File

@@ -1,5 +1,5 @@
/* /*
* $Id: getopt_getopt_long.c,v 1.2 2005-06-18 07:23:16 obarthel Exp $ * $Id: getopt_getopt_long.c,v 1.3 2005-06-26 12:01:50 tfrieden Exp $
* *
* :ts=4 * :ts=4
* *
@@ -348,10 +348,14 @@ static int getopt_long_internal(int argc, const char **argv, const char *optstri
* of this argv element, or we use the next argv element * of this argv element, or we use the next argv element
*/ */
if (nextchar) if (nextchar)
{
optarg = nextchar; optarg = nextchar;
nextchar = 0;
optind++;
}
else else
{ {
if (++optind >= argc) if (optind >= argc)
{ {
if (opterr) if (opterr)
fprintf(stderr, "%s: option requires an argument -- %c\n", fprintf(stderr, "%s: option requires an argument -- %c\n",