[meld/meld-1-8] Handle spaces in filenames with external editor (bgo#732089)



commit 358019d14370f55346a43132d7ff67e56f1eee84
Author: Kai Willadsen <kai willadsen gmail com>
Date:   Tue Jun 24 06:58:13 2014 +1000

    Handle spaces in filenames with external editor (bgo#732089)

 meld/preferences.py |    7 ++++---
 1 files changed, 4 insertions(+), 3 deletions(-)
---
diff --git a/meld/preferences.py b/meld/preferences.py
index 3a1389c..411cd1d 100644
--- a/meld/preferences.py
+++ b/meld/preferences.py
@@ -17,6 +17,7 @@
 ### USA.
 
 import logging
+import pipes
 import shlex
 import string
 
@@ -432,12 +433,12 @@ class MeldPreferences(prefs.Preferences):
             replacements = [tok[1] for tok in fmt.parse(custom_command)]
 
             if not any(replacements):
-                cmd = " ".join([custom_command, path])
+                return [custom_command, path]
             elif not all(r in (None, 'file', 'line') for r in replacements):
-                cmd = " ".join([custom_command, path])
                 log.error("Unsupported fields found", )
+                return [custom_command, path]
             else:
-                cmd = custom_command.format(file=path, line=line)
+                cmd = custom_command.format(file=pipes.quote(path), line=line)
             return shlex.split(cmd)
         else:
             if not hasattr(self, "_gconf"):


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]