From: cagney Date: Fri, 10 Aug 2001 23:46:14 +0000 (+0000) Subject: (lbasename): Change function declaration to return a const char pointer. X-Git-Tag: cygwin_daemon_merge_HEAD~3664 X-Git-Url: http://git.osdn.net/view?a=commitdiff_plain;h=b6da542feb706948f951c00901dfdb06386ffcea;p=pf3gnuchains%2Fpf3gnuchains4x.git (lbasename): Change function declaration to return a const char pointer. --- diff --git a/include/ChangeLog b/include/ChangeLog index 8b89d97beb..305754fec0 100644 --- a/include/ChangeLog +++ b/include/ChangeLog @@ -1,3 +1,8 @@ +2001-06-13 Andrew Cagney + + * libiberty.h (lbasename): Change function declaration to return a + const char pointer. + 2001-08-10 Richard Sandiford * opcode/mips.h (INSN_GP32): Remove. diff --git a/include/libiberty.h b/include/libiberty.h index effe5f628c..8d46e375e3 100644 --- a/include/libiberty.h +++ b/include/libiberty.h @@ -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. */ diff --git a/libiberty/ChangeLog b/libiberty/ChangeLog index c3fdb22c15..5c70d68ad3 100644 --- a/libiberty/ChangeLog +++ b/libiberty/ChangeLog @@ -1,3 +1,8 @@ +2001-06-13 Andrew Cagney + + * lbasename.c (lbasename): Change function definition to return a + const char pointer. + 2001-08-07 Jason Merrill * cp-demangle.c (demangle_special_name): "GR" -> "reference temporary diff --git a/libiberty/lbasename.c b/libiberty/lbasename.c index 7f870497c4..b37316259d 100644 --- a/libiberty/lbasename.c +++ b/libiberty/lbasename.c @@ -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; }