* regexec.c (group_nodes_into_DFAstates): Fix a buffer overrun
[gnulib.git] / lib / argp-namefrob.h
index d95f482..ea30864 100644 (file)
 #undef __argp_fmtstream_wmargin
 #define __argp_fmtstream_wmargin argp_fmtstream_wmargin
 
-/* GNULIB makes sure both program_invocation_name and
-   program_invocation_short_name are available */
-#ifdef GNULIB_PROGRAM_INVOCATION_NAME
-extern char *program_invocation_name;
-#undef HAVE_DECL_PROGRAM_INVOCATION_NAME
-#define HAVE_DECL_PROGRAM_INVOCATION_NAME 1
-#endif
-
-#ifdef GNULIB_PROGRAM_INVOCATION_SHORT_NAME
-extern char *program_invocation_short_name;
-#undef HAVE_DECL_PROGRAM_INVOCATION_SHORT_NAME
-#define HAVE_DECL_PROGRAM_INVOCATION_SHORT_NAME 1
-#endif
-
 #include "mempcpy.h"
 #include "strcase.h"
 #include "strchrnul.h"
@@ -155,7 +141,19 @@ extern char *program_invocation_short_name;
 # define putchar_unlocked(x) putchar (x)
 # endif
 
-extern char *__argp_basename (char *name);
+/* GNULIB makes sure both program_invocation_name and
+   program_invocation_short_name are available */
+#ifdef GNULIB_PROGRAM_INVOCATION_NAME
+extern char *program_invocation_name;
+# undef HAVE_DECL_PROGRAM_INVOCATION_NAME
+# define HAVE_DECL_PROGRAM_INVOCATION_NAME 1
+#endif
+
+#ifdef GNULIB_PROGRAM_INVOCATION_SHORT_NAME
+extern char *program_invocation_short_name;
+# undef HAVE_DECL_PROGRAM_INVOCATION_SHORT_NAME
+# define HAVE_DECL_PROGRAM_INVOCATION_SHORT_NAME 1
+#endif
 
 #endif /* !_LIBC */
 
@@ -163,11 +161,17 @@ extern char *__argp_basename (char *name);
 #define __set_errno(e) (errno = (e))
 #endif
 
-char * __argp_base_name (char *name);
+#if defined GNULIB_ARGP_DISABLE_DIRNAME
+# define __argp_base_name(arg) arg
+#elif defined GNULIB_ARGP_EXTERN_BASENAME
+extern char *__argp_base_name(const char *arg);
+#else
+# include "dirname.h"
+# define __argp_base_name base_name
+#endif
 
 #if defined _LIBC || HAVE_DECL_PROGRAM_INVOCATION_SHORT_NAME
 # define __argp_short_program_name()   (program_invocation_short_name)
 #else
 extern char *__argp_short_program_name (void);
 #endif
-