diff options
Diffstat (limited to 'scripts/config/confdata.c')
-rw-r--r-- | scripts/config/confdata.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/scripts/config/confdata.c b/scripts/config/confdata.c index c46aea81d..fd3a345e2 100644 --- a/scripts/config/confdata.c +++ b/scripts/config/confdata.c | |||
@@ -225,6 +225,8 @@ int conf_read(const char *name) | |||
225 | } | 225 | } |
226 | fclose(in); | 226 | fclose(in); |
227 | 227 | ||
228 | if (modules_sym) | ||
229 | sym_calc_value(modules_sym); | ||
228 | for_all_symbols(i, sym) { | 230 | for_all_symbols(i, sym) { |
229 | sym_calc_value(sym); | 231 | sym_calc_value(sym); |
230 | if (sym_has_value(sym) && !sym_is_choice_value(sym)) { | 232 | if (sym_has_value(sym) && !sym_is_choice_value(sym)) { |
@@ -265,8 +267,14 @@ int conf_write(const char *name) | |||
265 | 267 | ||
266 | dirname[0] = 0; | 268 | dirname[0] = 0; |
267 | if (name && name[0]) { | 269 | if (name && name[0]) { |
268 | char *slash = strrchr(name, '/'); | 270 | struct stat st; |
269 | if (slash) { | 271 | char *slash; |
272 | |||
273 | if (!stat(name, &st) && S_ISDIR(st.st_mode)) { | ||
274 | strcpy(dirname, name); | ||
275 | strcat(dirname, "/"); | ||
276 | basename = conf_def_filename; | ||
277 | } else if ((slash = strrchr(name, '/'))) { | ||
270 | int size = slash - name + 1; | 278 | int size = slash - name + 1; |
271 | memcpy(dirname, name, size); | 279 | memcpy(dirname, name, size); |
272 | dirname[size] = 0; | 280 | dirname[size] = 0; |