home *** CD-ROM | disk | FTP | other *** search
/ Current Shareware 1994 January / SHAR194.ISO / compress / zip20x.zip / ZIP386.PAT < prev    next >
Text File  |  1993-09-14  |  3KB  |  103 lines

  1. The following patch has been applied to the sources of zip 2.0
  2. to avoid creating entries for "./" and "../" in zip files with
  3. zip386.exe, compiled with DJGPP 1.10. The patch is not necessary
  4. for the 16 bit version zip.exe.
  5.  
  6. *** zip20/fileio.c    Tue Sep 14 12:12:40 1993
  7. --- fileio.c    Mon Sep 13 03:26:52 1993
  8. ***************
  9. *** 832,847 ****
  10.      file system.  Return an error code in the ZE_ class. */
  11.   {
  12.   # ifndef __GO32__
  13. -   char *a;              /* alloc'ed space for name */
  14.     dstrm *d;             /* stream for reading directory */
  15.     char *e;              /* name found in directory */
  16. !   int f;                /* true if there was a match */
  17.     char *n;              /* constructed name from directory */
  18.     char *p;              /* path */
  19.     char *q;              /* name */
  20. -   int r;                /* temporary variable */
  21.     char v[5];            /* space for device current directory */
  22. - # endif /* __GO32__ */
  23.   
  24.   # ifndef WIN32
  25.     if (volume_label == 1) {
  26. --- 832,847 ----
  27.      file system.  Return an error code in the ZE_ class. */
  28.   {
  29.   # ifndef __GO32__
  30.     dstrm *d;             /* stream for reading directory */
  31.     char *e;              /* name found in directory */
  32. !   int r;                /* temporary variable */
  33.     char *n;              /* constructed name from directory */
  34. + # endif /* __GO32__ */
  35. +   int f;                /* true if there was a match */
  36. +   char *a;              /* alloc'ed space for name */
  37.     char *p;              /* path */
  38.     char *q;              /* name */
  39.     char v[5];            /* space for device current directory */
  40.   
  41.   # ifndef WIN32
  42.     if (volume_label == 1) {
  43. ***************
  44. *** 855,863 ****
  45.       /* "zip -$ foo a:" can be used to force drive name */
  46.     }
  47.   # endif
  48. - # ifdef __GO32__
  49. -   return procname(w); /* expansion already done by DJGPP */
  50. - # else
  51.     /* Allocate and copy pattern */
  52.     if ((p = a = malloc(strlen(w) + 1)) == NULL)
  53.       return ZE_MEM;
  54. --- 855,860 ----
  55. ***************
  56. *** 908,914 ****
  57.           err(ZE_PARMS, "cannot remove parent directory");
  58.        return procname(p);
  59.     }
  60.     /* Search that level for matching names */
  61.     if ((d = opend(p)) == NULL)
  62.     {
  63. --- 905,917 ----
  64.           err(ZE_PARMS, "cannot remove parent directory");
  65.        return procname(p);
  66.     }
  67. ! # ifdef __GO32__
  68. !   /* expansion already done by DJGPP */
  69. !   f = 1;
  70. !   if (strcmp(q, ".") != 0 && strcmp(q, "..") != 0 && procname(w) != ZE_OK) {
  71. !      f = 0;
  72. !   }
  73. ! # else
  74.     /* Search that level for matching names */
  75.     if ((d = opend(p)) == NULL)
  76.     {
  77. ***************
  78. *** 950,960 ****
  79.       }
  80.     }
  81.     closed(d);
  82.   
  83.     /* Done */
  84.     free((voidp *)a);
  85.     return f ? ZE_OK : ZE_MISS;
  86. - # endif /* __GO32__ */
  87.   }
  88.   #endif /* MSDOS || OS2 */
  89.   
  90. --- 953,963 ----
  91.       }
  92.     }
  93.     closed(d);
  94. + # endif /* __GO32__ */
  95.   
  96.     /* Done */
  97.     free((voidp *)a);
  98.     return f ? ZE_OK : ZE_MISS;
  99.   }
  100.   #endif /* MSDOS || OS2 */
  101.   
  102.