This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: VAX PATCH: remove FILE_NAME_NONDIRECTORY


Forwarded message:
>From dave Wed Feb 21 20:20:12 EST 2001
Message-Id: <200102220120.UAA06548@hiauly1.hia.nrc.ca>
Subject: Re: VAX PATCH: remove FILE_NAME_NONDIRECTORY
To: dave@hiauly1.hia.nrc.ca (John David Anglin)
Date: Wed, 21 Feb 2001 20:20:09 -0500 (EST)
From: "John David Anglin" <dave@hiauly1.hia.nrc.ca>
Cc: lars.spam@nocrew.org
In-Reply-To: <no.id> from "John David Anglin" at Feb 21, 2001 05:32:02 pm
X-Mailer: ELM [version 2.4 PL25]
MIME-Version: 1.0
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit

This has gone through a complete bootstrap and check under i686 linux.
OK to install?

Dave

> 2001-02-21  John David Anglin  <dave@hiauly1.hia.nrc.ca>
> 
> 	* toplev.c (file_name_nondirectory): Use FILE_NAME_NONDIRECTORY macro
> 	if defined or basename algorithm from libiberty to extract the
> 	nondirectory portion of a file name.
> 
> --- toplev.c.orig	Mon Feb 19 16:39:55 2001
> +++ toplev.c	Wed Feb 21 17:15:17 2001
> @@ -1731,13 +1731,23 @@
>  file_name_nondirectory (x)
>       const char *x;
>  {
> -  char *tmp = (char *) strrchr (x, '/');
> -  if (DIR_SEPARATOR != '/' && ! tmp)
> -    tmp = (char *) strrchr (x, DIR_SEPARATOR);
> -  if (tmp)
> -    return (char *) (tmp + 1);
> -  else
> -    return (char *) x;
> +#ifndef FILE_NAME_NONDIRECTORY
> +  const char *base;
> +
> +#if defined (HAVE_DOS_BASED_FILE_SYSTEM)
> +  /* Skip over the disk name in MSDOS pathnames. */
> +  if (ISALPHA (x[0]) && x[1] == ':')
> +    x += 2;
> +#endif
> +
> +  for (base = x; *x; x++)
> +    if (IS_DIR_SEPARATOR (*x))
> +      base = x + 1;
> +
> +  return (char *) base;
> +#else
> +  return FILE_NAME_NONDIRECTORY (x);
> +#endif
>  }
>  
>  /* Output a quoted string.  */
> 

-- 
J. David Anglin                                  dave.anglin@nrc.ca
National Research Council of Canada              (613) 990-0752 (FAX: 952-6605)


-- 
J. David Anglin                                  dave.anglin@nrc.ca
National Research Council of Canada              (613) 990-0752 (FAX: 952-6605)


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]