This is the mail archive of the java-patches@gcc.gnu.org mailing list for the Java project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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


Ranjit Mathew writes:
 > Hi,
 > 
 >     This patch makes jcf-path.c use IS_DIR_SEPARATOR instead of
 > directly comparing against DIR_SEPARATOR. It also makes it
 > compare ZIP and JAR files in a case-insensitive manner if we
 > have a DOS-based filesystem as on Windows.
 > 
 > Ranjit.
 > 
 > 
 > Index: ChangeLog
 > from  Ranjit Mathew  <rmathew at hotmail dot com>
 > 
 > 	* jcf-path.c (add_entry): Compare ZIP and JAR files in a
 > 	case-insensitive way if we have a DOS-based filesystem.
 > 	Use IS_DIR_SEPARATOR instead of explicit checking against
 > 	DIR_SEPARATOR.
 > 	(jcf_path_extdirs_arg): Use IS_DIR_SEPARATOR instead of 
 > 	explicitly checking against DIR_SEPARATOR.
 > 
 > Index: jcf-path.c
 > ===================================================================
 > *** jcf-path.c	Mon Jan 27 21:43:44 2003
 > --- jcf-path.c	Tue Jan 28 20:28:07 2003
 > *************** add_entry (entp, filename, is_system)
 > *** 149,154 ****
 > --- 149,160 ----
 >   
 >     len = strlen (filename);
 > + 
 > + #if defined (HAVE_DOS_BASED_FILE_SYSTEM) && defined (HAVE_STRCASECMP)
 > +   if (len > 4 && (strcasecmp (filename + len - 4, ".zip") == 0
 > + 		  || strcasecmp (filename + len - 4, ".jar") == 0))
 > + #else
 >     if (len > 4 && (strcmp (filename + len - 4, ".zip") == 0
 >   		  || strcmp (filename + len - 4, ".jar") == 0))
 > + #endif

See Tom's comment -- declare COMPARE_FILENAMES appropriately.  We
don't want HAVE_DOS_BASED_FILE_SYSTEM all over the place if we can
possibly avoid it.

Otherwise this is fine.

Andrew.


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