Subversion Repositories SvarDOS

Rev

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

Rev 272 Rev 293
Line 83... Line 83...
83
}
83
}
84
 
84
 
85
 
85
 
86
static int pkginst(const char *file, int flags, const char *dosdir, const struct customdirs *dirlist) {
86
static int pkginst(const char *file, int flags, const char *dosdir, const struct customdirs *dirlist) {
87
  char pkgname[9];
87
  char pkgname[9];
88
  int t, lastpathdelim = -1, lastdot = -1;
88
  int t, lastpathdelim = -1, lastdot = -1, res = 1;
89
  struct ziplist *zipfileidx;
89
  struct ziplist *zipfileidx;
90
  FILE *zipfilefd;
90
  FILE *zipfilefd;
91
  /* copy the filename into pkgname (without path elements and without extension) */
91
  /* copy the filename into pkgname (without path elements and without extension) */
92
  for (t = 0; file[t] != 0; t++) {
92
  for (t = 0; file[t] != 0; t++) {
93
    switch (file[t]) {
93
    switch (file[t]) {
Line 109... Line 109...
109
  memcpy(pkgname, file + lastpathdelim + 1, t);
109
  memcpy(pkgname, file + lastpathdelim + 1, t);
110
  pkgname[t] = 0;
110
  pkgname[t] = 0;
111
  /* prepare the zip file and install it */
111
  /* prepare the zip file and install it */
112
  zipfileidx = pkginstall_preparepackage(pkgname, file, flags, &zipfilefd, dosdir, dirlist);
112
  zipfileidx = pkginstall_preparepackage(pkgname, file, flags, &zipfilefd, dosdir, dirlist);
113
  if (zipfileidx != NULL) {
113
  if (zipfileidx != NULL) {
114
    t = pkginstall_installpackage(pkgname, dosdir, dirlist, zipfileidx, zipfilefd);
114
    res = pkginstall_installpackage(pkgname, dosdir, dirlist, zipfileidx, zipfilefd);
115
    fclose(zipfilefd);
115
    zip_freelist(&zipfileidx);
116
    return(t);
-
 
117
  }
116
  }
118
 
117
 
119
  fclose(zipfilefd);
118
  fclose(zipfilefd);
120
  return(1);
119
  return(res);
121
}
120
}
122
 
121
 
123
 
122
 
124
int main(int argc, char **argv) {
123
int main(int argc, char **argv) {
125
  int res = 1;
124
  int res = 1;