Subversion Repositories SvarDOS

Rev

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

Rev 1964 Rev 1965
Line 9... Line 9...
9
#include <string.h>   /* strlen() */
9
#include <string.h>   /* strlen() */
10
#include <sys/types.h>
10
#include <sys/types.h>
11
#include <direct.h> /* opendir() and friends */
11
#include <direct.h> /* opendir() and friends */
12
 
12
 
13
#include "helpers.h"  /* fdnpkg_strcasestr(), slash2backslash()... */
13
#include "helpers.h"  /* fdnpkg_strcasestr(), slash2backslash()... */
14
#include "kprintf.h"
-
 
15
#include "libunzip.h"  /* zip_freelist()... */
14
#include "libunzip.h"  /* zip_freelist()... */
16
#include "lsm.h"
15
#include "lsm.h"
17
#include "svarlang.lib\svarlang.h"
16
#include "svarlang.lib\svarlang.h"
18
 
17
 
19
#include "showinst.h"  /* include self for control */
18
#include "showinst.h"  /* include self for control */
Line 27... Line 26...
27
  int matchfound = 0;
26
  int matchfound = 0;
28
 
27
 
29
  sprintf(buff, "%s\\appinfo", dosdir);
28
  sprintf(buff, "%s\\appinfo", dosdir);
30
  dp = opendir(buff);
29
  dp = opendir(buff);
31
  if (dp == NULL) {
30
  if (dp == NULL) {
32
    kitten_printf(9, 0, buff); /* "ERROR: Could not access directory %s" */
31
    output(svarlang_str(9,0)); /* "ERROR: Could not access directory */
33
    outputnl("");
32
    output(" ");
-
 
33
    outputnl(buff);
34
    return(-1);
34
    return(-1);
35
  }
35
  }
36
 
36
 
37
  while ((ep = readdir(dp)) != NULL) { /* readdir() result must never be freed (statically allocated) */
37
  while ((ep = readdir(dp)) != NULL) { /* readdir() result must never be freed (statically allocated) */
38
    int tlen = strlen(ep->d_name);
38
    int tlen = strlen(ep->d_name);
Line 81... Line 81...
81
  fd = fopen(buff, "rb");
81
  fd = fopen(buff, "rb");
82
  if (fd == NULL) {
82
  if (fd == NULL) {
83
    sprintf(buff, "%s\\appinfo\\%s.lsm", dosdir, pkgname);
83
    sprintf(buff, "%s\\appinfo\\%s.lsm", dosdir, pkgname);
84
    fd = fopen(buff, "rb");
84
    fd = fopen(buff, "rb");
85
    if (fd == NULL) {
85
    if (fd == NULL) {
86
      kitten_printf(9, 1, pkgname); /* "ERROR: Local package '%s' not found." */
86
      sprintf(buff, svarlang_str(9, 1), pkgname); /* "ERROR: Local package '%s' not found." */
87
      outputnl("");
87
      outputnl(buff);
88
      return(NULL);
88
      return(NULL);
89
    }
89
    }
90
  }
90
  }
91
 
91
 
92
  /* iterate through all lines of the file */
92
  /* iterate through all lines of the file */
Line 107... Line 107...
107
    trimfnamecrc(buff);
107
    trimfnamecrc(buff);
108
 
108
 
109
    /* add the new node to the result */
109
    /* add the new node to the result */
110
    newnode = malloc(sizeof(struct flist_t) + strlen(buff));
110
    newnode = malloc(sizeof(struct flist_t) + strlen(buff));
111
    if (newnode == NULL) {
111
    if (newnode == NULL) {
112
      kitten_printf(2, 14, "malloc failure"); /* "Out of memory! (%s)" */
112
      outputnl(svarlang_str(2,14));  /* "Out of memory!" */
113
      continue;
113
      continue;
114
    }
114
    }
115
    newnode->next = res;
115
    newnode->next = res;
116
    strcpy(newnode->fname, buff);
116
    strcpy(newnode->fname, buff);
117
    res = newnode;
117
    res = newnode;