diff options
| -rw-r--r-- | clojure/src/readline.clj | 2 | ||||
| -rw-r--r-- | java/src/main/java/mal/readline.java | 6 | ||||
| -rw-r--r-- | php/readline.php | 2 |
3 files changed, 7 insertions, 3 deletions
diff --git a/clojure/src/readline.clj b/clojure/src/readline.clj index dbd4872..0fc449a 100644 --- a/clojure/src/readline.clj +++ b/clojure/src/readline.clj @@ -3,7 +3,7 @@ [net.n01se.clojure-jna :as jna])) (defonce history-loaded (atom nil)) -(def HISTORY-FILE "/home/joelm/.mal-history") +(def HISTORY-FILE (str (System/getProperty "user.home") "/.mal-history")) ;; ;; Uncomment one of the following readline libraries diff --git a/java/src/main/java/mal/readline.java b/java/src/main/java/mal/readline.java index 1705f39..9220267 100644 --- a/java/src/main/java/mal/readline.java +++ b/java/src/main/java/mal/readline.java @@ -19,9 +19,13 @@ class readline { public enum Mode { JNA, JAVA } static Mode mode = Mode.JNA; - static String HISTORY_FILE = "/home/joelm/.mal-history"; + static String HISTORY_FILE = null; static Boolean historyLoaded = false; + static { + HISTORY_FILE = System.getProperty("user.home") + "/.mal-history"; + } + public static class EOFException extends Exception { } diff --git a/php/readline.php b/php/readline.php index 28d720d..d4b3ad7 100644 --- a/php/readline.php +++ b/php/readline.php @@ -1,6 +1,6 @@ <?php -$HISTORY_FILE = "/home/joelm/.mal-history"; +$HISTORY_FILE = $_SERVER['HOME'] . "/.mal-history"; function mal_readline($prompt) { global $HISTORY_FILE; |
