GNU bug report logs - #8321
23.1; emerge error diff extra operand

Previous Next

Package: emacs;

Reported by: "Mark H. David" <mhd <at> yv.org>

Date: Tue, 22 Mar 2011 16:54:02 UTC

Severity: normal

Found in version 23.1

Done: Eli Zaretskii <eliz <at> gnu.org>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Eli Zaretskii <eliz <at> gnu.org>
To: "Mark H. David" <mhd <at> yv.org>
Cc: 8321 <at> debbugs.gnu.org
Subject: bug#8321: 23.1; emerge error diff extra operand
Date: Tue, 22 Mar 2011 21:48:27 +0200
> Date: Tue, 22 Mar 2011 15:31:43 -0400
> From: "Mark H. David" <mhd <at> yv.org>
> 
> Thanks for checking on this so fast!
> 
> Wow, actually having a full pathname with no spaces worked.

If so, I think this is already fixed in the development sources.  Can
you try the patch below?


--- lisp/emerge.el~0	2011-03-10 19:56:29.093750000 +0200
+++ lisp/emerge.el	2011-03-18 23:48:44.187500000 +0200
@@ -3187,21 +3187,26 @@
 
 ;; Metacharacters that have to be protected from the shell when executing
 ;; a diff/diff3 command.
-(defcustom emerge-metachars "[ \t\n!\"#$&'()*;<=>?[\\^`{|~]"
-  "Characters that must be quoted with \\ when used in a shell command line.
+(defcustom emerge-metachars
+  (if (memq system-type '(ms-dos windows-nt))
+      "[ \t\"<>|?*^&=]"
+    "[ \t\n!\"#$&'()*;<=>?[\\^`{|~]")
+  "Characters that must be quoted when used in a shell command line.
 More precisely, a [...] regexp to match any one such character."
   :type 'regexp
   :group 'emerge)
 
 ;; Quote metacharacters (using \) when executing a diff/diff3 command.
 (defun emerge-protect-metachars (s)
-  (let ((limit 0))
-    (while (string-match emerge-metachars s limit)
-      (setq s (concat (substring s 0 (match-beginning 0))
-		      "\\"
-		      (substring s (match-beginning 0))))
-      (setq limit (1+ (match-end 0)))))
-  s)
+  (if (memq system-type '(ms-dos windows-nt))
+      (shell-quote-argument s)
+    (let ((limit 0))
+      (while (string-match emerge-metachars s limit)
+	(setq s (concat (substring s 0 (match-beginning 0))
+			"\\"
+			(substring s (match-beginning 0))))
+	(setq limit (1+ (match-end 0)))))
+    s))
 
 (provide 'emerge)
 




This bug report was last modified 14 years and 66 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.