This is the mail archive of the
java@gcc.gnu.org
mailing list for the Java project.
Re: For Review: Sanitise Use of DIR_SEPARATOR in the Front-End
- From: Tom Tromey <tromey at redhat dot com>
- To: Ranjit Mathew <rmathew at hotmail dot com>
- Cc: java at gcc dot gnu dot org
- Date: 28 Jan 2003 14:37:24 -0700
- Subject: Re: For Review: Sanitise Use of DIR_SEPARATOR in the Front-End
- References: <b16iok$ku1$1@main.gmane.org>
- Reply-to: tromey at redhat dot com
>>>>> "Ranjit" == Ranjit Mathew <rmathew@hotmail.com> writes:
Ranjit> If any of this looks pathetic to you, do be nice enough to point
Ranjit> out a better way of achieving the same. (The strcasecmp( ) thing
Ranjit> makes the code look ugly - perhaps we can use a function pointer
Ranjit> there?)
You could just have a new function-style define:
#ifdef ...
#define COMPARE_FILENAMES(..) strcasecmp(..)
...
I'd prefer that to having more #ifs in the body of the code.
Maybe there is already such a define somewhere.
Ranjit> In addition, I found a small issue with assuming a
Ranjit> case-sensitive filesystem while scanning the classpath for ZIP
Ranjit> or JAR files, and have included the fix for the same.
What part of the patch is it? If it is independent it should go in as
a separate fix.
Ranjit> /* Get the name of the directory. */
Ranjit> sep = strrchr (filename, DIR_SEPARATOR);
Ranjit> +#ifdef DIR_SEPARATOR_2
Ranjit> + if (! sep)
Ranjit> + sep = strrchr (filename, DIR_SEPARATOR_2);
Ranjit> +#endif
Code like this should be rewritten. This isn't reliable if a path
contains both `\' and `/'. I don't know if that is a valid situation.
libiberty must have a directory-name-finding function...? That way
"someone else" can worry about the details.
Overall this is looking good.
Have you looked at making libgcj build on a case-insensitive file
system? That failure is a longstanding complaint of Windows users.
Tom