From 132d2a2da7fc02842ac3c40419a9ef623e410ff2 Mon Sep 17 00:00:00 2001 From: Angus Leeming Date: Thu, 5 Jan 2006 14:13:14 +0000 Subject: [PATCH] Enable instant preview to work if the path to GhostScript contains spaces (bug 2193). git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@10710 a592a061-630c-0410-9148-cb99ea01b6c8 --- lib/ChangeLog | 6 ++++++ lib/scripts/lyxpreview_tools.py | 6 +++++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/lib/ChangeLog b/lib/ChangeLog index b22f9a282b..579c24e92a 100644 --- a/lib/ChangeLog +++ b/lib/ChangeLog @@ -1,3 +1,9 @@ +2006-01-05 Angus Leeming + + * 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 * layouts/amsart-seq.layout: fix typo in counter diff --git a/lib/scripts/lyxpreview_tools.py b/lib/scripts/lyxpreview_tools.py index 272f3158de..bab609706a 100644 --- a/lib/scripts/lyxpreview_tools.py +++ b/lib/scripts/lyxpreview_tools.py @@ -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 -- 2.39.2