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: (patch) protoize fixes for windows32


On Thu, Jan 06, 2000 at 02:55:35AM -0600, Mumit Khan wrote:
> -    dir_last_slash = strrchr (dir_name, '/');
> +    dir_last_slash = strrchr (dir_name, DIR_SEPARATOR);
>      if (dir_last_slash)
> -      *dir_last_slash = '\0';
> +      {
> +#ifdef DIR_SEPARATOR_2
> +        char *slash;
> +
> +	slash = strrchr (dir_last_slash, DIR_SEPARATOR_2);
> +	if (slash)
> +	  dir_last_slash = slash;
> +#endif
> +	*dir_last_slash = '\0';
> +      }
>      else
>        abort ();  /* Should have been an absolutized filename.  */

Seems like you're missing some DIR_SEPARATOR_2 handling.
Shouldn't this be

	dir_last_slash = strrchr (dir_name, DIR_SEPARATOR);
#ifdef DIR_SEPARATOR_2
	{
	  char *slash;
	  slash = strrchr (dir_last_slash ? dir_last_slash : dir_name,
			   DIR_SEPARATOR_2);
	  if (slash)
	    dir_last_slash = slash;
	}
#endif
	if (dir_last_slash)
	  *dir_last_slash = '\0';
	else
	  abort ();  /* Should have been an absolutized filename.  */

There are two other similar fragments.

Otherwise it looks ok.


r~

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