bug-diffutils
[Top][All Lists]
Advanced

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

Re: [bug-diffutils] [PATCH] quoting in diff3 on win32


From: Eric Blake
Subject: Re: [bug-diffutils] [PATCH] quoting in diff3 on win32
Date: Thu, 25 Aug 2011 16:31:54 -0600
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.20) Gecko/20110817 Fedora/3.1.12-1.fc14 Lightning/1.0b3pre Mnenhy/0.8.3 Thunderbird/3.1.12

On 08/25/2011 01:58 PM, Claudio Bley wrote:
Hi.

I compiled diffutils for MinGW.

diff3.exe does not work with special characters in path names (like
spaces et cetera) because it does not quote special characters
correctly for the cmd shell when invoking diff.exe.

Gross. It would be better to get the mingw environment to use sh instead of cmd, or to at least fix system() or popen() to properly munge command lines that assumed sh quoting into something that will work when passed to cmd, and to put that fix in mingw (or perhaps in gnulib) for all projects to benefit from, than to hack up diffutils to support a non-standard, poorly documented, and painful alternate quoting mechanism just for a non-free shell.

@@ -1217,6 +1267,9 @@
    p = shell_quote_copy (p, filea);
    *p++ = ' ';
    p = shell_quote_copy (p, fileb);
+#if defined(WIN32)&&  !defined(__CYGWIN__)
+  *p++ = '"';
+#endif
    *p = 0;
    errno = 0;
    fpipe = popen (command, "r");

Or, instead of using popen, maybe we could use gnulib's pipe-filter-gi module, which allows us to pass the filename as a distinct argv argument without the need for any extra quoting to be undone by an intermediate shell.

All in all, while I appreciate your attempt to make this more robust on mingw, I think this patch is going about a solution in the wrong way.

--
Eric Blake   address@hidden    +1-801-349-2682
Libvirt virtualization library http://libvirt.org



reply via email to

[Prev in Thread] Current Thread [Next in Thread]