OSDN Git Service

(lbasename): Change function declaration to return a const char pointer.
authorcagney <cagney@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 10 Aug 2001 23:45:11 +0000 (23:45 +0000)
committercagney <cagney@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 10 Aug 2001 23:45:11 +0000 (23:45 +0000)
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@44782 138bc75d-0d04-0410-961f-82ee72b054a4

include/ChangeLog
include/libiberty.h
libiberty/ChangeLog
libiberty/lbasename.c

index 9f34dcd..f0d141e 100644 (file)
@@ -1,3 +1,8 @@
+2001-06-13  Andrew Cagney  <ac131313@redhat.com>
+
+       * libiberty.h (lbasename): Change function declaration to return a
+       const char pointer.
+
 2001-08-02  Mark Kettenis  <kettenis@gnu.org>
 
        * xregex.h (_REGEX_RE_COMP): Define.
index effe5f6..8d46e37 100644 (file)
@@ -83,7 +83,7 @@ extern char *basename ();
 
 /* A well-defined basename () that is always compiled in.  */
 
-extern char *lbasename PARAMS ((const char *));
+extern const char *lbasename PARAMS ((const char *));
 
 /* Concatenate an arbitrary number of strings, up to (char *) NULL.
    Allocates memory using xmalloc.  */
index 5a9f0d2..c80b809 100644 (file)
@@ -1,3 +1,8 @@
+2001-06-13  Andrew Cagney  <ac131313@redhat.com>
+
+       * lbasename.c (lbasename): Change function definition to return a
+       const char pointer.
+
 2001-08-07  Jason Merrill  <jason_merrill@redhat.com>
 
        * cp-demangle.c (demangle_special_name): "GR" -> "reference temporary
index 7f87049..b373162 100644 (file)
@@ -23,7 +23,7 @@ NAME
        lbasename -- return pointer to last component of a pathname
 
 SYNOPSIS
-       char *lbasename (const char *name)
+       const char *lbasename (const char *name)
 
 DESCRIPTION
        Given a pointer to a string containing a typical pathname
@@ -69,7 +69,7 @@ DESCRIPTION
 #  endif
 #endif
 
-char *
+const char *
 lbasename (name)
      const char *name;
 {
@@ -85,5 +85,5 @@ lbasename (name)
     if (IS_DIR_SEPARATOR (*name))
       base = name + 1;
 
-  return (char *) base;
+  return base;
 }