diff options
author | Neil Moore <neil@s-z.org> | 2014-05-12 18:00:32 -0400 |
---|---|---|
committer | Neil Moore <neil@s-z.org> | 2014-05-12 18:11:14 -0400 |
commit | 9bc6d1f085097d001f0ff31f9bb900bb71957212 (patch) | |
tree | ca6c52fa82eac19c98baec7ce93b557e4d5be22e /crawl-ref/source/files.cc | |
parent | bca6d2d0ab66b008f7f1664769ba4a3a655a3444 (diff) | |
download | crawl-ref-9bc6d1f085097d001f0ff31f9bb900bb71957212.tar.gz crawl-ref-9bc6d1f085097d001f0ff31f9bb900bb71957212.zip |
Formatting fixes (add braces).
This fixes all the instances caught by unbrace.
Diffstat (limited to 'crawl-ref/source/files.cc')
-rw-r--r-- | crawl-ref/source/files.cc | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/crawl-ref/source/files.cc b/crawl-ref/source/files.cc index 612526e493..5d220c9688 100644 --- a/crawl-ref/source/files.cc +++ b/crawl-ref/source/files.cc @@ -364,8 +364,10 @@ void assert_read_safe_path(const string &path) throw (string) #ifdef UNIX if (!shell_safe(path.c_str())) + { throw make_stringf("\"%s\" contains bad characters.", path.c_str()); + } #endif #ifdef DATA_DIR_PATH @@ -766,8 +768,10 @@ public: if (tmp_filename != target_filename) { if (rename_u(tmp_filename.c_str(), target_filename.c_str())) + { end(1, true, "failed to rename %s -> %s", tmp_filename.c_str(), target_filename.c_str()); + } } } @@ -778,11 +782,13 @@ public: filep = (lock? lk_open(filemode, tmp_filename) : fopen_u(tmp_filename.c_str(), filemode)); if (!filep) + { end(-1, true, "Failed to open \"%s\" (%s; locking:%s)", tmp_filename.c_str(), filemode, lock? "YES" : "no"); + } } return filep; } |