~peter-pearse/ubuntu/natty/zip/prop001

« back to all changes in this revision

Viewing changes to human68k/human68k.c

  • Committer: Bazaar Package Importer
  • Author(s): Santiago Vila
  • Date: 2009-04-11 20:27:34 UTC
  • mfrom: (1.1.3 upstream)
  • Revision ID: james.westby@ubuntu.com-20090411202734-628cvtydgn7wue48
Tags: 3.0-1
* New upstream release. Closes: #496986, #520562.
* This release has large file support. Closes: #308345.
* zipcloak, zipnote and zipsplit have now manpages. Closes: #411828.
* Warning: If you use any of the new features, you might need unzip 6.0
  (not released yet) for unzipping. You have been warned.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/*
2
 
  Copyright (c) 1990-2005 Info-ZIP.  All rights reserved.
 
2
  Copyright (c) 1990-1999 Info-ZIP.  All rights reserved.
3
3
 
4
 
  See the accompanying file LICENSE, version 2004-May-22 or later
 
4
  See the accompanying file LICENSE, version 1999-Oct-05 or later
5
5
  (the contents of which are also included in zip.h) for terms of use.
6
6
  If, for some reason, both of these files are missing, the Info-ZIP license
7
 
  also may be found at:  ftp://ftp.info-zip.org/pub/infozip/license.html
 
7
  also may be found at:  ftp://ftp.cdrom.com/pub/infozip/license.html
8
8
*/
9
9
#include "zip.h"
10
10
 
39
39
int wild(char* w)
40
40
{
41
41
  struct _filbuf inf;
42
 
  char name[FNMAX];
 
42
  /* convert FNAMX to malloc - 11/08/04 EG */
 
43
  char *name;
43
44
  char *p;
44
45
 
45
46
  if (strcmp(w, "-") == 0)   /* if compressing stdin */
46
47
    return newname(w, 0, 0);
 
48
  if ((name = malloc(strlen(w) + 1)) == NULL) {
 
49
    ZIPERR(ZE_MEM, "wild");
 
50
  }
47
51
  strcpy(name, w);
48
52
  _toslash(name);
49
53
 
51
55
    p = name;
52
56
  else
53
57
    p++;
54
 
  if (_dos_lfiles (&inf, w, 0xff) < 0)
 
58
  if (_dos_lfiles (&inf, w, 0xff) < 0) {
 
59
    free(name);
55
60
    return ZE_MISS;
 
61
  }
56
62
  do {
57
63
    int r;
58
64
 
59
65
    strcpy(p, inf.name);
60
66
    r = procname(name, 0);
61
 
    if (r != ZE_OK)
 
67
    if (r != ZE_OK) {
 
68
      free(name);
62
69
      return r;
 
70
    }
63
71
  } while (_dos_nfiles(&inf) >= 0);
 
72
  free(name);
64
73
 
65
74
  return ZE_OK;
66
75
}
231
240
   a file size of -1 */
232
241
{
233
242
  struct stat s;        /* results of stat() */
 
243
  /* convert FNMAX to malloc - 11/8/04 EG */
234
244
  char *name;
235
 
  unsigned int len = strlen(f);
236
 
  int isstdin = !strcmp(f, "-");
 
245
  int len = strlen(f);
 
246
  isstdin = !strcmp(f, "-");
237
247
 
238
248
  if ((name = malloc(len + 1)) == NULL) {
239
249
    ZIPERR(ZE_MEM, "filetime");
263
273
      atr = 0x20;
264
274
    *a = ((ulg)s.st_mode << 16) | (isstdin ? 0L : (ulg)atr);
265
275
  }
 
276
  free(name);
266
277
  if (n != NULL)
267
278
    *n = S_ISVOL(s.st_mode) ? -2L : S_ISREG(s.st_mode) ? s.st_size : -1L;
268
279
  if (t != NULL) {
271
282
    t->ctime = s.st_ctime;
272
283
  }
273
284
 
274
 
  free(name);
275
 
 
276
285
  return unix2dostime(&s.st_mtime);
277
286
}
278
287