about summary refs log tree commit diff
path: root/misc
diff options
context:
space:
mode:
Diffstat (limited to 'misc')
-rw-r--r--misc/libgen.h10
1 files changed, 8 insertions, 2 deletions
diff --git a/misc/libgen.h b/misc/libgen.h
index 2c5d642e15..4eb4d15ff8 100644
--- a/misc/libgen.h
+++ b/misc/libgen.h
@@ -26,8 +26,14 @@ __BEGIN_DECLS
 /* Return directory part of PATH or "." if none is available.  */
 extern char *dirname __P ((char *__path));
 
-/* Return filename part of PATH.  */
-extern char *basename __P ((__const char *__path));
+/* Return final component of PATH.
+
+   This is the weird XPG version of this function.  It sometimes will
+   modify its argument.  Therefore we normally use the GNU version (in
+   <string.h>) and only if this header is included make the XPG
+   version available under the real name.  */
+extern char *__xpg_basename __P ((char *__path));
+#define basename(path)	__xpg_basename (path)
 
 __END_DECLS