View | Details | Raw Unified | Return to bug 984945
Collapse All | Expand All

(-)zip30.orig/unix/unix.c (-21 / +29 lines)
Lines 13-18 Link Here
13
#ifndef UTIL    /* the companion #endif is a bit of ways down ... */
13
#ifndef UTIL    /* the companion #endif is a bit of ways down ... */
14
14
15
#include <time.h>
15
#include <time.h>
16
#include <errno.h>
16
17
17
#if defined(MINIX) || defined(__mpexl)
18
#if defined(MINIX) || defined(__mpexl)
18
#  ifdef S_IWRITE
19
#  ifdef S_IWRITE
Lines 176-204 Link Here
176
      }
177
      }
177
    }
178
    }
178
    /* recurse into directory */
179
    /* recurse into directory */
179
    if (recurse && (d = opendir(n)) != NULL)
180
    if (recurse)
180
    {
181
    {
181
      while ((e = readd(d)) != NULL) {
182
      if ((d = opendir(n)) != NULL) {
182
        if (strcmp(e, ".") && strcmp(e, ".."))
183
        while (errno=0, (e = readd(d)) != NULL) {
183
        {
184
	  if (strcmp(e, ".") && strcmp(e, ".."))
184
          if ((a = malloc(strlen(p) + strlen(e) + 1)) == NULL)
185
	  {
185
          {
186
	    if ((a = malloc(strlen(p) + strlen(e) + 1)) == NULL)
186
            closedir(d);
187
	    {
187
            free((zvoid *)p);
188
	      closedir(d);
188
            return ZE_MEM;
189
	      free((zvoid *)p);
189
          }
190
	      return ZE_MEM;
190
          strcat(strcpy(a, p), e);
191
	    }
191
          if ((m = procname(a, caseflag)) != ZE_OK)   /* recurse on name */
192
	    strcat(strcpy(a, p), e);
192
          {
193
	    if ((m = procname(a, caseflag)) != ZE_OK)   /* recurse on name */
193
            if (m == ZE_MISS)
194
	    {
194
              zipwarn("name not matched: ", a);
195
	      if (m == ZE_MISS)
195
            else
196
		zipwarn("name not matched: ", a);
196
              ziperr(m, a);
197
	      else
197
          }
198
		ziperr(m, a);
198
          free((zvoid *)a);
199
	    }
199
        }
200
	    free((zvoid *)a);
201
	  }
202
	}
203
        if (errno) {
204
	  ziperr(ZE_READ, n);
205
	}
206
	closedir(d);
207
      } else {
208
	ziperr(ZE_READ, n);
200
      }
209
      }
201
      closedir(d);
202
    }
210
    }
203
    free((zvoid *)p);
211
    free((zvoid *)p);
204
  } /* (s.st_mode & S_IFDIR) */
212
  } /* (s.st_mode & S_IFDIR) */

Return to bug 984945