Mail Archives: djgpp-workers/1997/09/08/00:27:22
> Actually, I put in a call to _preserve_fncase (wrapped with #ifdef
> __DJGPP__) for those lines (437).
That won't do the Right Thing. I need to preserve case all the time,
since the zips might get UNzipped under Win95. My system is DOS.
Also, you don't want to preserve case when expanding wildcards or
recursing into directories, because under DOS they end up all upper
case (ick).
> Are there more? I haven't had any problems since.
Here's the patch I sent to the zip maintainers:
diff -c3 -r oldzip/msdos/msdos.c zip/msdos/msdos.c
*** oldzip/msdos/msdos.c Tue Apr 23 11:59:02 1996
--- zip/msdos/msdos.c Mon Sep 8 00:18:34 1997
***************
*** 186,191 ****
--- 186,197 ----
if (strcmp(w, "-") == 0) /* if compressing stdin */
return newname(w, 0);
+ #ifdef __DJGPP__
+ /* If the user specifies a file, preserve mixed case and long names. */
+ if (strpbrk(w, "*?") == 0 && access(w, D_OK))
+ return procname(w);
+ #endif
+
/* Allocate and copy pattern */
if ((p = a = malloc(strlen(w) + 1)) == NULL)
return ZE_MEM;
***************
*** 258,263 ****
--- 264,270 ----
{
f = 1;
if (strcmp(p, ".") == 0) { /* path is . */
+ strlwr(e);
r = procname(e); /* name is name */
if (r) {
f = 0;
***************
*** 273,279 ****
n = strcpy(n, p);
if (n[r = strlen(n) - 1] != '/' && n[r] != ':')
strcat(n, "/");
! r = procname(strcat(n, e)); /* name is path/name */
free((zvoid *)n);
if (r) {
f = 0;
--- 280,288 ----
n = strcpy(n, p);
if (n[r = strlen(n) - 1] != '/' && n[r] != ':')
strcat(n, "/");
! strcat(n, e);
! strlwr(n);
! r = procname(n); /* name is path/name */
free((zvoid *)n);
if (r) {
f = 0;
***************
*** 381,386 ****
--- 390,396 ----
return ZE_MEM;
}
strcat(strcpy(a, p), e);
+ strlwr(a);
if ((m = procname(a)) != ZE_OK) /* recurse on name */
{
if (m == ZE_MISS)
***************
*** 433,440 ****
--- 443,457 ----
if (dosify)
msname(n);
+ #ifndef __DJGPP__
+ /* DJGPP supports case-sensitive and long file names (Win95), so
+ we have to be careful to lower case the file only when we are
+ doing wildcard expansion (above) and not when the file is
+ specified by the user explicitly. */
else
strlwr(n);
+ #endif
+
if (pdosflag)
*pdosflag = dosflag;
return n;
- Raw text -