Subversion Repositories SvarDOS

Rev

Rev 1892 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 1892 Rev 1931
Line 7... Line 7...
7
#include <string.h> /* strcasecmp() */
7
#include <string.h> /* strcasecmp() */
8
#include <stdlib.h> /* malloc(), free() */
8
#include <stdlib.h> /* malloc(), free() */
9
 
9
 
10
#include "helpers.h" /* slash2backslash(), removeDoubleBackslashes()... */
10
#include "helpers.h" /* slash2backslash(), removeDoubleBackslashes()... */
11
#include "kprintf.h"
11
#include "kprintf.h"
-
 
12
#include "svarlang.lib\svarlang.h"
12
 
13
 
13
#include "loadconf.h"
14
#include "loadconf.h"
14
 
15
 
15
 
16
 
16
void freeconf(struct customdirs **dirlist) {
17
void freeconf(struct customdirs **dirlist) {
Line 91... Line 92...
91
  char *value = NULL;
92
  char *value = NULL;
92
  char token[512];
93
  char token[512];
93
  int nline = 0;
94
  int nline = 0;
94
  const char *PKG_CFG = " (PKG.CFG)";
95
  const char *PKG_CFG = " (PKG.CFG)";
95
 
96
 
-
 
97
  /* load config file from %DOSDIR%\PKG.CFG */
96
  snprintf(token, sizeof(token), "%s\\cfg\\pkg.cfg", dosdir);
98
  snprintf(token, sizeof(token), "%s\\pkg.cfg", dosdir);
97
  fd = fopen(token, "r");
99
  fd = fopen(token, "r");
-
 
100
  /* if not found then try the legacy location at %DOSDIR%\CFG\PKG.CFG */
98
  if (fd == NULL) {
101
  if (fd == NULL) {
-
 
102
    snprintf(token, sizeof(token), "%s\\cfg\\pkg.cfg", dosdir);
-
 
103
    fd = fopen(token, "r");
-
 
104
    if (fd == NULL) {
99
    kitten_printf(7, 1, token); /* "ERROR: Could not open config file (%s)!" */
105
      kitten_printf(7, 1, "%DOSDIR%\\PKG.CFG"); /* "ERROR: Could not open config file (%s)!" */
-
 
106
    } else {
-
 
107
      kitten_printf(7, 17, token);  /* "ERROR: PKG.CFG found at %s */
-
 
108
      puts("");
-
 
109
      puts(svarlang_str(7, 18));    /* Please move it to %DOSDIR%\PKG.CFG */
-
 
110
    }
100
    puts("");
111
    puts("");
101
    return(-1);
112
    return(-1);
102
  }
113
  }
103
 
114
 
104
  *dirlist = NULL;
115
  *dirlist = NULL;