summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBardur Arantsson <bardur@scientician.net>2012-06-27 20:04:05 +0200
committerBardur Arantsson <bardur@scientician.net>2012-06-27 20:05:58 +0200
commit6bf06677908ff25c98980b24a46057dbf3124cce (patch)
tree06e635831afd1e5b6d544d882803817349e2cc4f
parentd49211e82c52a62920f78b7faec77c275467bd24 (diff)
Auto-create "user" directory if necessary
This fixes a bug where creation of the "scores" file would fail when selecting the Theme module with no pre-existing ~/.tome/2.3/theme directory.
-rw-r--r--src/modules.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/modules.c b/src/modules.c
index 0c9250eb..088dfbd7 100644
--- a/src/modules.c
+++ b/src/modules.c
@@ -58,6 +58,11 @@ void module_reset_dir(cptr dir, cptr new_path)
strnfmt(buf, 1024, "%s%s%s", user_path, PATH_SEP, new_path);
string_free(*d);
*d = string_make(buf);
+ // Make it if needed */
+ if (!private_check_user_directory(*d))
+ {
+ quit(format("Unable to create module dir %s\n", *d));
+ }
}
#ifdef PRIVATE_USER_PATH_DATA
else if (!strcmp(dir, "data"))