Subversion Repositories SvarDOS

Rev

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

Rev 259 Rev 260
Line 89... Line 89...
89
  *dirlist = newentry;
89
  *dirlist = newentry;
90
  return(0);
90
  return(0);
91
}
91
}
92
 
92
 
93
 
93
 
94
int loadconf(const char *dosdir, struct customdirs **dirlist, int *flags) {
94
int loadconf(const char *dosdir, struct customdirs **dirlist) {
95
  FILE *fd;
95
  FILE *fd;
96
  char *value = NULL;
96
  char *value = NULL;
97
  char token[512];
97
  char token[512];
98
  int nline = 0;
98
  int nline = 0;
99
 
99
 
Line 103... Line 103...
103
    kitten_printf(7, 1, "Error: Could not open config file (%s)!", token);
103
    kitten_printf(7, 1, "Error: Could not open config file (%s)!", token);
104
    puts("");
104
    puts("");
105
    return(-1);
105
    return(-1);
106
  }
106
  }
107
 
107
 
-
 
108
  *dirlist = NULL;
-
 
109
 
108
  /* read the config file line by line */
110
  /* read the config file line by line */
109
  while (freadtokval(fd, token, sizeof(token), &value, ' ') == 0) {
111
  while (freadtokval(fd, token, sizeof(token), &value, ' ') == 0) {
110
    nline++;
112
    nline++;
111
 
113
 
112
    /* skip comments and empty lines */
114
    /* skip comments and empty lines */
Line 117... Line 119...
117
      puts("");
119
      puts("");
118
      continue;
120
      continue;
119
    }
121
    }
120
 
122
 
121
    /* printf("token='%s' ; value = '%s'\n", token, value); */
123
    /* printf("token='%s' ; value = '%s'\n", token, value); */
122
    if (strcasecmp(token, "SKIPLINKS") == 0) {
-
 
123
      int tmpint = atoi(value); /* must be 0/1 */
-
 
124
      if (tmpint == 0) {
-
 
125
        /* do nothing */
-
 
126
      } else if (tmpint == 1) {
-
 
127
        *flags |= PKGINST_SKIPLINKS;
-
 
128
      } else {
-
 
129
        kitten_printf(7, 10, "Warning: Ignored an illegal '%s' value at line #%d", "skiplinks", nline);
-
 
130
        puts("");
-
 
131
      }
-
 
132
    } else if (strcasecmp(token, "DIR") == 0) { /* custom directory entry */
124
    if (strcasecmp(token, "DIR") == 0) { /* custom directory entry */
133
      char *argv[2];
125
      char *argv[2];
134
      if (parsecmd(value, argv, 2) != 2) {
126
      if (parsecmd(value, argv, 2) != 2) {
135
        kitten_printf(7, 11, "Warning: Invalid 'DIR' directive found at line #%d", nline);
127
        kitten_printf(7, 11, "Warning: Invalid 'DIR' directive found at line #%d", nline);
136
        puts("");
128
        puts("");
137
      }
129
      }