This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: (patch) protoize fixes for windows32
- To: Mumit Khan <khan at nanotech dot wisc dot edu>
- Subject: Re: (patch) protoize fixes for windows32
- From: Richard Henderson <rth at cygnus dot com>
- Date: Thu, 6 Jan 2000 12:38:09 -0800
- Cc: gcc-patches at gcc dot gnu dot org
- References: <200001060855.CAA07036@mercury.xraylith.wisc.edu>
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~