(patch) protoize fixes for windows32

Richard Henderson rth@cygnus.com
Thu Jan 6 12:38:00 GMT 2000


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~


More information about the Gcc-patches mailing list