Subversion Repositories SvarDOS

Rev

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

Rev 262 Rev 268
Line 1... Line 1...
1
/*
1
/*
2
 * This file is part of pkginst (SvarDOS).
2
 * This file is part of pkg (SvarDOS).
3
 *
-
 
4
 * Loads the list of repositories from a config file.
-
 
5
 *
-
 
6
 * Copyright (C) 2012-2021 Mateusz Viste
3
 * Copyright (C) 2012-2021 Mateusz Viste
7
 */
4
 */
8
 
5
 
9
#include <stdio.h>  /* printf(), fclose(), fopen()... */
6
#include <stdio.h>  /* printf(), fclose(), fopen()... */
10
#include <string.h> /* strcasecmp() */
7
#include <string.h> /* strcasecmp() */
Line 94... Line 91...
94
  FILE *fd;
91
  FILE *fd;
95
  char *value = NULL;
92
  char *value = NULL;
96
  char token[512];
93
  char token[512];
97
  int nline = 0;
94
  int nline = 0;
98
 
95
 
99
  snprintf(token, sizeof(token), "%s\\cfg\\pkginst.cfg", dosdir);
96
  snprintf(token, sizeof(token), "%s\\cfg\\pkg.cfg", dosdir);
100
  fd = fopen(token, "r");
97
  fd = fopen(token, "r");
101
  if (fd == NULL) {
98
  if (fd == NULL) {
102
    kitten_printf(7, 1, "Error: Could not open config file (%s)!", token);
99
    kitten_printf(7, 1, "Error: Could not open config file (%s)!", token);
103
    puts("");
100
    puts("");
104
    return(-1);
101
    return(-1);