summaryrefslogtreecommitdiff
path: root/extra/config/confdata.c
diff options
context:
space:
mode:
Diffstat (limited to 'extra/config/confdata.c')
-rw-r--r--extra/config/confdata.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/extra/config/confdata.c b/extra/config/confdata.c
index 4b4d150c7..56aff3c03 100644
--- a/extra/config/confdata.c
+++ b/extra/config/confdata.c
@@ -225,6 +225,8 @@ int conf_read(const char *name)
}
fclose(in);
+ if (modules_sym)
+ sym_calc_value(modules_sym);
for_all_symbols(i, sym) {
sym_calc_value(sym);
if (sym_has_value(sym) && !sym_is_choice_value(sym)) {
@@ -265,8 +267,14 @@ int conf_write(const char *name)
dirname[0] = 0;
if (name && name[0]) {
- char *slash = strrchr(name, '/');
- if (slash) {
+ struct stat st;
+ char *slash;
+
+ if (!stat(name, &st) && S_ISDIR(st.st_mode)) {
+ strcpy(dirname, name);
+ strcat(dirname, "/");
+ basename = conf_def_filename;
+ } else if ((slash = strrchr(name, '/'))) {
int size = slash - name + 1;
memcpy(dirname, name, size);
dirname[size] = 0;