Subversion Repositories SvarDOS

Rev

Rev 1609 | Rev 1964 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 1609 Rev 1963
Line 11... Line 11...
11
#include <time.h>      /* mktime() */
11
#include <time.h>      /* mktime() */
12
#include <utime.h>     /* utime() */
12
#include <utime.h>     /* utime() */
13
#include <unistd.h>   /* unlink() */
13
#include <unistd.h>   /* unlink() */
14
 
14
 
15
#include "crc32.h"
15
#include "crc32.h"
-
 
16
#include "helpers.h"
16
#include "kprintf.h"
17
#include "kprintf.h"
17
#include "inf.h"   /* INFLATE support */
18
#include "inf.h"   /* INFLATE support */
18
 
19
 
19
#include "libunzip.h"  /* include self for control */
20
#include "libunzip.h"  /* include self for control */
20
 
21
 
Line 87... Line 88...
87
      filenamelen |= hdrbuff[22];
88
      filenamelen |= hdrbuff[22];
88
      /* create new entry and link it into the list */
89
      /* create new entry and link it into the list */
89
      newentry = calloc(sizeof(struct ziplist) + filenamelen, 1);
90
      newentry = calloc(sizeof(struct ziplist) + filenamelen, 1);
90
      if (newentry == NULL) {
91
      if (newentry == NULL) {
91
        kitten_printf(2, 14, "libunzip"); /* "Out of memory! (%s)" */
92
        kitten_printf(2, 14, "libunzip"); /* "Out of memory! (%s)" */
92
        puts("");
93
        outputnl("");
93
        zip_freelist(&reslist);
94
        zip_freelist(&reslist);
94
        break;
95
        break;
95
      }
96
      }
96
      newentry->nextfile = reslist;
97
      newentry->nextfile = reslist;
97
      newentry->flags = 0;
98
      newentry->flags = 0;
Line 148... Line 149...
148
    } else if (entrysig == 0x08074b50ul) { /* Data descriptor header */
149
    } else if (entrysig == 0x08074b50ul) { /* Data descriptor header */
149
      /* no need to read the header we just have to skip it */
150
      /* no need to read the header we just have to skip it */
150
      fseek(fd, 12, SEEK_CUR); /* the header is 3x4 bytes (CRC + compressed len + uncompressed len) */
151
      fseek(fd, 12, SEEK_CUR); /* the header is 3x4 bytes (CRC + compressed len + uncompressed len) */
151
    } else { /* unknown sig */
152
    } else { /* unknown sig */
152
      kitten_printf(8, 1, entrysig); /* "unknown zip sig: 0x%08lx" */
153
      kitten_printf(8, 1, entrysig); /* "unknown zip sig: 0x%08lx" */
153
      puts("");
154
      outputnl("");
154
      zip_freelist(&reslist);
155
      zip_freelist(&reslist);
155
      break;
156
      break;
156
    }
157
    }
157
  }
158
  }
158
  /* if we got no central directory record, the file is incomplete */
159
  /* if we got no central directory record, the file is incomplete */