summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/files.cc
diff options
context:
space:
mode:
authordshaligram <dshaligram@c06c8d41-db1a-0410-9941-cceddc491573>2006-12-15 11:26:00 +0000
committerdshaligram <dshaligram@c06c8d41-db1a-0410-9941-cceddc491573>2006-12-15 11:26:00 +0000
commitdd6871b0fbac350ea175d88e5b2bc340a5fb6e30 (patch)
treea5d03236d042f9c52c095304f74a323452d82778 /crawl-ref/source/files.cc
parent80ff6b26122857839ec18211fae01b734618fd34 (diff)
downloadcrawl-ref-dd6871b0fbac350ea175d88e5b2bc340a5fb6e30.tar.gz
crawl-ref-dd6871b0fbac350ea175d88e5b2bc340a5fb6e30.zip
Added -morgue option to specify where morgues are saved.
Added -macro option to specify location of macro file. Morgue files are named morgue-<cname>-<time>.txt, provided Crawl is compiled without SHORT_FILE_NAMES. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@637 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/files.cc')
-rw-r--r--crawl-ref/source/files.cc12
1 files changed, 7 insertions, 5 deletions
diff --git a/crawl-ref/source/files.cc b/crawl-ref/source/files.cc
index 757783a045..82e4c75259 100644
--- a/crawl-ref/source/files.cc
+++ b/crawl-ref/source/files.cc
@@ -404,10 +404,10 @@ std::string datafile_path(const std::string &basename)
return ("");
}
-void check_savedir(std::string &dir)
+bool check_dir(const std::string &whatdir, std::string &dir)
{
if (dir.empty())
- return;
+ return (true);
std::string sep = " ";
sep[0] = FILE_SEPARATOR;
@@ -421,11 +421,13 @@ void check_savedir(std::string &dir)
if (!dir_exists(dir) && !create_dirs(dir))
{
- fprintf(stderr, "Save directory \"%s\" does not exist "
+ fprintf(stderr, "%s \"%s\" does not exist "
"and I can't create it.\n",
- dir.c_str());
- exit(1);
+ whatdir.c_str(), dir.c_str());
+ return (false);
}
+
+ return (true);
}
// Given a simple (relative) name of a save file, returns the full path of