about summary refs log tree commit diff
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>1998-04-28 19:41:51 +0000
committerUlrich Drepper <drepper@redhat.com>1998-04-28 19:41:51 +0000
commit5b155773ee9c869d926e35039c244bbdfc249384 (patch)
tree8625e62eacebf723e8d8314ebf8bf6e76a18fea5
parent733bb62a1e04206c836cf47df1c237421df98c5f (diff)
downloadglibc-5b155773ee9c869d926e35039c244bbdfc249384.tar.gz
glibc-5b155773ee9c869d926e35039c244bbdfc249384.tar.xz
glibc-5b155773ee9c869d926e35039c244bbdfc249384.zip
Update.
	* string/basename.c [!_LIBC]: Define function as gnu_basename.

	* posix/getopt.c [!__GNU_LIBRARY__]: Include string.h or
	strings.h.
-rw-r--r--ChangeLog5
-rw-r--r--posix/getopt.c9
-rw-r--r--string/basename.c9
3 files changed, 19 insertions, 4 deletions
diff --git a/ChangeLog b/ChangeLog
index 5d0580006c..1c5b262b78 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,10 @@
 1998-04-28  Ulrich Drepper  <drepper@cygnus.com>
 
+	* string/basename.c [!_LIBC]: Define function as gnu_basename.
+
+	* posix/getopt.c [!__GNU_LIBRARY__]: Include string.h or
+	strings.h.
+
 	* stdlib/grouping.h: Accept ungrouped numbers even if locale
 	defines grouping.
 
diff --git a/posix/getopt.c b/posix/getopt.c
index 4cbf3614cc..4d837c041a 100644
--- a/posix/getopt.c
+++ b/posix/getopt.c
@@ -198,15 +198,18 @@ static char *posixly_correct;
 # define my_index	strchr
 #else
 
+# if HAVE_STRING_H
+#  include <string.h>
+# else
+#  include <strings.h>
+# endif
+
 /* Avoid depending on library functions or files
    whose names are inconsistent.  */
 
 #ifndef getenv
 extern char *getenv ();
 #endif
-#ifndef strncmp
-extern int strncmp ();
-#endif
 
 static char *
 my_index (str, chr)
diff --git a/string/basename.c b/string/basename.c
index f24e0ac1b4..ce1b4de3da 100644
--- a/string/basename.c
+++ b/string/basename.c
@@ -1,5 +1,5 @@
 /* Return the name-within-directory of a file name.
-   Copyright (C) 1996, 1997 Free Software Foundation, Inc.
+   Copyright (C) 1996, 1997, 1998 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
    The GNU C Library is free software; you can redistribute it and/or
@@ -23,6 +23,13 @@
 
 #include <string.h>
 
+#ifndef _LIBC
+/* We cannot generally use the name `basename' since XPG defines an unusable
+   variant of the function but we cannot use it.  */
+# define basename gnu_basename
+#endif
+
+
 char *
 basename (filename)
      const char *filename;