diff options
author | Andrew Morton <akpm@osdl.org> | 2004-03-18 15:00:19 -0800 |
---|---|---|
committer | Linus Torvalds <torvalds@ppc970.osdl.org> | 2004-03-18 15:00:19 -0800 |
commit | 86b5b992be8e8753cacf4f80fcb5bc644fa503c2 (patch) | |
tree | bd1989b96452026d6404a40d9cf5f208e89e63f8 /scripts | |
parent | dfc78642dbcb8b9550a9e0efe6b42c0ec5050ae5 (diff) | |
download | history-86b5b992be8e8753cacf4f80fcb5bc644fa503c2.tar.gz |
[PATCH] kconfig: don't rename target dir when saving config
From: Roman Zippel <zippel@linux-m68k.org>
conf_write() now checks the target path whether it's a directory, so it
saves the config in the directory instead of renaming it.
Diffstat (limited to 'scripts')
-rw-r--r-- | scripts/kconfig/confdata.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/scripts/kconfig/confdata.c b/scripts/kconfig/confdata.c index abbd6cf0188591..cf551c4b101253 100644 --- a/scripts/kconfig/confdata.c +++ b/scripts/kconfig/confdata.c @@ -269,8 +269,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; |