]> git.lyx.org Git - features.git/commitdiff
Enable instant preview to work if the path to GhostScript contains spaces (bug
authorAngus Leeming <leeming@lyx.org>
Thu, 5 Jan 2006 14:13:14 +0000 (14:13 +0000)
committerAngus Leeming <leeming@lyx.org>
Thu, 5 Jan 2006 14:13:14 +0000 (14:13 +0000)
2193).

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@10710 a592a061-630c-0410-9148-cb99ea01b6c8

lib/ChangeLog
lib/scripts/lyxpreview_tools.py

index b22f9a282b0ba06b32a3df74d9a09020e5203123..579c24e92a0d397029787128d85414c49f99ab88 100644 (file)
@@ -1,3 +1,9 @@
+2006-01-05  Angus Leeming  <leeming@lyx.org>
+
+       * scripts/lyxpreview_tools.py (find_exe): return only the basename of
+       the executable to avoid problems when the path to the exe contains
+       spaces. Fixes bug 2193.
+
 2006-01-02  Michael Gerz  <michael.gerz@teststep.org>
 
        * layouts/amsart-seq.layout: fix typo in counter
index 272f3158de9b4c2d90324d4bff57f71d532634ce..bab609706ad92e8df8cfe848e9af5c8ecf0db426 100644 (file)
@@ -52,7 +52,11 @@ def find_exe(candidates, path):
                 full_path = os.path.join(directory, prog)
 
             if os.access(full_path, os.X_OK):
-                return full_path
+                # The thing is in the PATH already (or we wouldn't
+                # have found it). Return just the basename to avoid
+                # problems when the path to the executable contains
+                # spaces.
+                return os.path.basename(full_path)
 
     return None