summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/files.cc
diff options
context:
space:
mode:
authordshaligram <dshaligram@c06c8d41-db1a-0410-9941-cceddc491573>2006-12-14 07:01:29 +0000
committerdshaligram <dshaligram@c06c8d41-db1a-0410-9941-cceddc491573>2006-12-14 07:01:29 +0000
commit4b7d62bb60b9559290a67645368e2dd72865e173 (patch)
tree54195fa092df6890c39cfcb542af8655cc14f040 /crawl-ref/source/files.cc
parent7f78db9414b3c2dd97da70ce74198f0360cdedc6 (diff)
downloadcrawl-ref-4b7d62bb60b9559290a67645368e2dd72865e173.tar.gz
crawl-ref-4b7d62bb60b9559290a67645368e2dd72865e173.zip
Removed SHORT_FILE_NAMES for Windows builds.
Fixed poisoned needles not stacking correctly. Allow character names to end with digits on multiuser systems. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@628 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/files.cc')
-rw-r--r--crawl-ref/source/files.cc14
1 files changed, 6 insertions, 8 deletions
diff --git a/crawl-ref/source/files.cc b/crawl-ref/source/files.cc
index 5653948834..757783a045 100644
--- a/crawl-ref/source/files.cc
+++ b/crawl-ref/source/files.cc
@@ -208,7 +208,7 @@ static std::string uid_as_string()
{
#ifdef MULTIUSER
char struid[20];
- snprintf( struid, sizeof struid, "%d", (int)getuid() );
+ snprintf( struid, sizeof struid, "-%d", (int)getuid() );
return std::string(struid);
#else
return std::string();
@@ -229,13 +229,7 @@ static bool is_uid_file(const std::string &name, const std::string &ext)
std::string::size_type suffix_pos = name.find(save_suffix);
return (suffix_pos != std::string::npos
&& suffix_pos == name.length() - save_suffix.length()
- && suffix_pos != 0
-#ifdef MULTIUSER
- // See verifyPlayerName() in newgame.cc
- && !isdigit(name[suffix_pos - 1])
-#endif
- );
-
+ && suffix_pos != 0);
}
bool is_save_file_name(const std::string &name)
@@ -347,6 +341,10 @@ static bool create_dirs(const std::string &dir)
path += segments[i];
path += FILE_SEPARATOR;
+ // Handle absolute paths correctly.
+ if (i == 0 && dir.size() && dir[0] == FILE_SEPARATOR)
+ path = FILE_SEPARATOR + path;
+
if (!dir_exists(path) && create_directory(path.c_str()))
return (false);
}