Patch: jcf-path.c and filename case-insensitivity on Win32

Tom Tromey tromey@redhat.com
Sat Mar 1 23:43:00 GMT 2003


>>>>> "Ranjit" == Ranjit Mathew <rmathew@hotmail.com> writes:

Ranjit> 	* jcf-path.c (add_entry): Compare ZIP and JAR files in a
Ranjit> 	case-insensitive way if we have a DOS-based filesystem.
Ranjit> 	Use IS_DIR_SEPARATOR instead of explicit checking against
Ranjit> 	DIR_SEPARATOR.
Ranjit> 	(jcf_path_extdirs_arg): Use IS_DIR_SEPARATOR instead of 
Ranjit> 	explicitly checking against DIR_SEPARATOR.

Andrew will have to review this, but...

Ranjit> + #if defined (HAVE_DOS_BASED_FILE_SYSTEM) && defined (HAVE_STRCASECMP)
Ranjit> +   if (len > 4 && (strcasecmp (filename + len - 4, ".zip") == 0
Ranjit> + 		  || strcasecmp (filename + len - 4, ".jar") == 0))
Ranjit> + #else
Ranjit>     if (len > 4 && (strcmp (filename + len - 4, ".zip") == 0
Ranjit>   		  || strcmp (filename + len - 4, ".jar") == 0))
Ranjit> + #endif

I'd prefer we add a new macro, like COMPARE_FILENAMES, and then define
that as strcmp or strcasecmp.

Best would be to do this in system.h, though personally I'd settle for
some header in gcc/java/.

Tom



More information about the Java-patches mailing list