|
From: <dsh...@us...> - 2007-04-02 11:26:28
|
Revision: 1187
http://svn.sourceforge.net/crawl-ref/?rev=1187&view=rev
Author: dshaligram
Date: 2007-04-02 04:26:27 -0700 (Mon, 02 Apr 2007)
Log Message:
-----------
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.
Modified Paths:
--------------
trunk/crawl-ref/source/AppHdr.h
trunk/crawl-ref/source/macro.cc
Modified: trunk/crawl-ref/source/AppHdr.h
===================================================================
--- trunk/crawl-ref/source/AppHdr.h 2007-04-02 07:18:11 UTC (rev 1186)
+++ trunk/crawl-ref/source/AppHdr.h 2007-04-02 11:26:27 UTC (rev 1187)
@@ -227,6 +227,10 @@
// Uses <playername>-macro.txt as the macro file if uncommented.
// #define DGL_NAMED_MACRO_FILE
+
+ // Uses Options.macro_dir as the full path to the macro file. Mutually
+ // exclusive with DGL_NAMED_MACRO_FILE.
+ #define DGL_MACRO_ABSOLUTE_PATH
#endif
// =========================================================================
Modified: trunk/crawl-ref/source/macro.cc
===================================================================
--- trunk/crawl-ref/source/macro.cc 2007-04-02 07:18:11 UTC (rev 1186)
+++ trunk/crawl-ref/source/macro.cc 2007-04-02 11:26:27 UTC (rev 1187)
@@ -175,15 +175,19 @@
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)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|