tags 550843 +patch
thanks

Here’s a patch to fix this by launching the editor command via /bin/sh.  I 
also sent this upstream:
http://lists.askja.de/pipermail/ldapvi/2010-December/000084.html
diff -u ldapvi-1.7/debian/changelog ldapvi-1.7/debian/changelog
--- ldapvi-1.7/debian/changelog
+++ ldapvi-1.7/debian/changelog
@@ -1,3 +1,10 @@
+ldapvi (1.7-8) unstable; urgency=low
+
+  * debian/patches/06_editor-arguments: Handle editor commands with
+    arguments.  (Closes: #550843)
+
+ -- Anders Kaseorg <[email protected]>  Tue, 14 Dec 2010 15:33:30 -0500
+
 ldapvi (1.7-7) unstable; urgency=low
 
   * Change libreadline5-dev to libreadline-dev (closes: #553795)
diff -u ldapvi-1.7/debian/patches/series ldapvi-1.7/debian/patches/series
--- ldapvi-1.7/debian/patches/series
+++ ldapvi-1.7/debian/patches/series
@@ -5,0 +6 @@
+06_editor-arguments
only in patch2:
unchanged:
--- ldapvi-1.7.orig/debian/patches/06_editor-arguments
+++ ldapvi-1.7/debian/patches/06_editor-arguments
@@ -0,0 +1,44 @@
+From: Anders Kaseorg <[email protected]>
+Subject: Handle editor commands with arguments
+
+Previously when the EDITOR environment variable is set to a command
+with arguments, such as ‘emacsclient --alternate-editor emacs’, ldapvi
+would fail to launch the editor:
+
+$ ldapvi
+     26 entries read
+error (misc.c line 180): No such file or directory
+editor died
+error (ldapvi.c line 83): No such file or directory
+
+Fix this by launching the editor via /bin/sh.
+
+Bug-Debian: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=550843
+Forwarded: http://lists.askja.de/pipermail/ldapvi/2010-December/000084.html
+Last-Update: 2010-12-14
+
+---
+ misc.c |    6 ++++--
+ 1 files changed, 4 insertions(+), 2 deletions(-)
+
+diff --git a/misc.c b/misc.c
+index 3b6896e..c50ff0d 100644
+--- a/misc.c
++++ b/misc.c
+@@ -172,9 +172,11 @@ edit(char *pathname, long line)
+               if (line > 0) {
+                       char buf[20];
+                       snprintf(buf, 20, "+%ld", line);
+-                      execlp(vi, vi, buf, pathname, 0);
++                      execlp("/bin/sh", "sh", "-c", "exec $0 \"$...@\"", vi,
++                             buf, pathname, 0);
+               } else
+-                      execlp(vi, vi, pathname, 0);
++                      execlp("/bin/sh", "sh", "-c", "exec $0 \"$...@\"", vi,
++                             pathname, 0);
+               syserr();
+       }
+ 
+-- 
+1.7.3.3
+

Reply via email to