diff options
author | dshaligram <dshaligram@c06c8d41-db1a-0410-9941-cceddc491573> | 2007-04-02 11:26:27 +0000 |
---|---|---|
committer | dshaligram <dshaligram@c06c8d41-db1a-0410-9941-cceddc491573> | 2007-04-02 11:26:27 +0000 |
commit | aab231295dfe36b6e4dce0d318e9ae710fd17512 (patch) | |
tree | e626c2f339bcc98948d244dd5e5d29e8bc8a525a /crawl-ref/source/macro.cc | |
parent | 5ae6f9b2a31ad184fda48d086109111ef0cfa809 (diff) | |
download | crawl-ref-aab231295dfe36b6e4dce0d318e9ae710fd17512.tar.gz crawl-ref-aab231295dfe36b6e4dce0d318e9ae710fd17512.zip |
Added #ifdef to allow compatibility with the old -macro <file> option. This
option is restricted to dgamelaunch because it has security issues if used with
the traditional multiuser setuid/setgid install.
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@1187 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/macro.cc')
-rw-r--r-- | crawl-ref/source/macro.cc | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/crawl-ref/source/macro.cc b/crawl-ref/source/macro.cc index 3a14a0c4ef..2420971a40 100644 --- a/crawl-ref/source/macro.cc +++ b/crawl-ref/source/macro.cc @@ -175,15 +175,19 @@ static std::string get_macro_file() if (!dir.empty()) { +#ifndef DGL_MACRO_ABSOLUTE_PATH if (dir[dir.length() - 1] != FILE_SEPARATOR) dir += FILE_SEPARATOR; +#endif } -#ifdef DGL_NAMED_MACRO_FILE +#if defined(DGL_MACRO_ABSOLUTE_PATH) + return (dir.empty()? "macro.txt" : dir); +#elif defined(DGL_NAMED_MACRO_FILE) return (dir + strip_filename_unsafe_chars(you.your_name) + "-macro.txt"); #else return (dir + "macro.txt"); -#endif +#endif } static void buf2keyseq(const char *buff, keyseq &k) |