]> git.donarmstrong.com Git - lilypond.git/commitdiff
Fix lilypond-invoke-editor's temp dir
authorMasamichi Hosoda <trueroad@trueroad.jp>
Mon, 4 May 2015 09:59:44 +0000 (18:59 +0900)
committerMasamichi Hosoda <trueroad@trueroad.jp>
Mon, 4 May 2015 09:59:44 +0000 (18:59 +0900)
Issue 4359

To use environment variable TMP and TEMP is
Windows-only conventions.
The POSIX convention is
to look in the TMPDIR.

scripts/lilypond-invoke-editor.scm

index 313d6cc8dc3acab9c56a7cac124e09c518850695..6658f50166dfe4d98f56d2d2aad068d4e291f864 100644 (file)
@@ -151,9 +151,12 @@ Options:
     (if (running-from-gui?)
        (redirect-port (current-error-port)
                       (open-file (string-append
-                                  (or (getenv "TMP")
-                                      (getenv "TEMP")
-                                      "/tmp")
+                                   (if (string-match "^(Windows|CYGWIN)"
+                                                     (utsname:sysname (uname)))
+                                       (or (getenv "TMP")
+                                           (getenv "TEMP"))
+                                       (or (getenv "TMPDIR")
+                                           "/tmp"))
                                   "/lilypond-invoke-editor.log") "a")))
     (if (not (= (length files) 1))
        (begin