]> git.lyx.org Git - lyx.git/blobdiff - lib/scripts/lyxpreview_tools.py
Fix bug 3220
[lyx.git] / lib / scripts / lyxpreview_tools.py
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