(configdir): New, to be used for loading configuration tables.
(emp_config): Set it to econfig's directory.
This commit is contained in:
parent
376d87c3a0
commit
e4865d473e
3 changed files with 16 additions and 2 deletions
|
@ -78,6 +78,7 @@ emp_config(char *file)
|
|||
char scanspace[1024];
|
||||
char *av[128];
|
||||
char buf[1024];
|
||||
char *slash;
|
||||
struct keymatch *kp;
|
||||
int lno = 0;
|
||||
int errors = 0;
|
||||
|
@ -94,6 +95,11 @@ emp_config(char *file)
|
|||
return -1;
|
||||
}
|
||||
|
||||
if ((slash = strrchr(file, '/')))
|
||||
configdir = strndup(file, slash + 1 - file);
|
||||
else
|
||||
configdir = NULL;
|
||||
|
||||
while (fgets(buf, sizeof buf, fp) != NULL) {
|
||||
++lno;
|
||||
for (i = 0; buf[i] && isspace(buf[i]); ++i) ;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue