- Allocate buffer large enough to contain UNIX_PATH_MAX size pathnames in case of...
[oweals/gnunet.git] / src / util / getopt.c
index c37272442068dea62f8abe3efc494310607e8094..7b2f3cf5d9d8d96cec3b1c457e501284b542668c 100644 (file)
@@ -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,
@@ -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 <unixlib.h>
@@ -351,7 +349,7 @@ _getopt_initialize (int argc,
 
   return optstring;
 }
-\f
+
 /* 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;
 }