X-Git-Url: https://git.librecmc.org/?a=blobdiff_plain;f=src%2Futil%2Fgetopt.c;h=e150496ae22989f29a909ca5f33c9fc74fa0a29e;hb=d5bcc06e5c6bff2a33b31011d0c1b75d253a4a2f;hp=c37272442068dea62f8abe3efc494310607e8094;hpb=a36bf48b6976f86398669a71e72fe078737410bc;p=oweals%2Fgnunet.git diff --git a/src/util/getopt.c b/src/util/getopt.c index c37272442..e150496ae 100644 --- a/src/util/getopt.c +++ b/src/util/getopt.c @@ -3,7 +3,7 @@ "Keep this file name-space clean" means, talk to roland@gnu.ai.mit.edu before changing it! - Copyright (C) 1987, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97 + Copyright Copyright (C) 1987, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97 Free Software Foundation, Inc. NOTE: The canonical source of this file is maintained with the GNU C Library. @@ -11,7 +11,7 @@ Bugs can be reported to bug-glibc@prep.ai.mit.edu. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the -Free Software Foundation; either version 2, or (at your option) any +Free Software Foundation; either version 3, or (at your option) any later version. This program is distributed in the hope that it will be useful, @@ -21,12 +21,12 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software -Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, +Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. This code was heavily modified for GNUnet. -Copyright (C) 2006 Christian Grothoff +Copyright Copyright (C) 2006 Christian Grothoff */ /** @@ -37,10 +37,8 @@ Copyright (C) 2006 Christian Grothoff * replace main GNU getopt parser with one that * actually fits our API. */ - #include "platform.h" -#include "gnunet_common.h" -#include "gnunet_getopt_lib.h" +#include "gnunet_util_lib.h" #ifdef VMS #include @@ -351,7 +349,7 @@ _getopt_initialize (int argc, return optstring; } - + /* Scan elements of ARGV (whose length is ARGC) for option characters given in OPTSTRING. @@ -767,8 +765,7 @@ GN_getopt_internal (int argc, char *const *argv, const char *optstring, else { if (GNopterr) - FPRINTF (stderr, _("\ -%s: option `-W %s' does not allow an argument\n"), argv[0], pfound->name); + FPRINTF (stderr, _("%s: option `-W %s' does not allow an argument\n"), argv[0], pfound->name); nextchar += strlen (nextchar); return '?'; @@ -940,8 +937,10 @@ GNUNET_GETOPT_run (const char *binaryOptions, GNUNET_free (shorts); GNUNET_free (long_options); - if (cont == GNUNET_SYSERR) - return GNUNET_SYSERR; + if (cont != GNUNET_OK) + { + return cont; + } return GNoptind; }