From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Laimonas =?UTF-8?Q?V=C4=97bra?= Newsgroups: gmane.emacs.bugs Subject: bug#6784: 24.0.50; cmdproxy incosistency with command pathnames Date: Wed, 04 Aug 2010 13:28:58 +0300 Message-ID: <4C5940EA.7030301@gmail.com> References: <87iq3radvf.fsf@telefonica.net> <83pqxzy5me.fsf@gnu.org> <87ocdj8tyh.fsf@telefonica.net> <4C585DAB.5030609@gmail.com> <83mxt3xzqh.fsf@gnu.org> <4C5878E2.1020402@gmail.com> <4C5882AC.5050201@gmail.com> <83k4o7xefq.fsf@gnu.org> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Trace: dough.gmane.org 1280918300 27568 80.91.229.12 (4 Aug 2010 10:38:20 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Wed, 4 Aug 2010 10:38:20 +0000 (UTC) Cc: 6784@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Wed Aug 04 12:38:17 2010 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1OgbMW-0002Mh-DA for geb-bug-gnu-emacs@m.gmane.org; Wed, 04 Aug 2010 12:38:16 +0200 Original-Received: from localhost ([127.0.0.1]:47888 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OgbMV-00022n-Q0 for geb-bug-gnu-emacs@m.gmane.org; Wed, 04 Aug 2010 06:38:15 -0400 Original-Received: from [140.186.70.92] (port=33531 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OgbMN-0001zp-Op for bug-gnu-emacs@gnu.org; Wed, 04 Aug 2010 06:38:09 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OgbMM-0002Sw-Ke for bug-gnu-emacs@gnu.org; Wed, 04 Aug 2010 06:38:07 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:36410) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OgbMM-0002Sr-HK for bug-gnu-emacs@gnu.org; Wed, 04 Aug 2010 06:38:06 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.69) (envelope-from ) id 1OgbDa-0004ZH-8o; Wed, 04 Aug 2010 06:29:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Laimonas =?UTF-8?Q?V=C4=97bra?= Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-To: owner@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 04 Aug 2010 10:29:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 6784 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 6784-submit@debbugs.gnu.org id=B6784.128091771817551 (code B ref 6784); Wed, 04 Aug 2010 10:29:02 +0000 Original-Received: (at 6784) by debbugs.gnu.org; 4 Aug 2010 10:28:38 +0000 Original-Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OgbDC-0004Z0-5J for submit@debbugs.gnu.org; Wed, 04 Aug 2010 06:28:38 -0400 Original-Received: from mail-ey0-f172.google.com ([209.85.215.172]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OgbDA-0004Yv-2L for 6784@debbugs.gnu.org; Wed, 04 Aug 2010 06:28:36 -0400 Original-Received: by eyb7 with SMTP id 7so1801191eyb.3 for <6784@debbugs.gnu.org>; Wed, 04 Aug 2010 03:29:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from :user-agent:mime-version:to:cc:subject:references:in-reply-to :content-type:content-transfer-encoding; bh=bDd2BhrJcbLMmyld7aYLZ/dg6xPCsd3BzQv6osQoJYE=; b=Yk8xp2Ncmlr8GskVHoRw080OyVRlqStlGoTgQjzmav9DtgNS3UEbROHog77pLjG3Iz Wum9xFqfDO0GjXnrMCQHcqPiYSRPD4lZNYC7hAHNKlSbUZKn+p/qCPeBY8u0DgR6YfHC BmCgW3otobhacREX3VMgYCs6Vnzux/LpIctgw= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:content-type:content-transfer-encoding; b=ozsKTZrgysFIklL/3K3G8bOBfQxGtCCo4zC9Xl7HlO7QIJ2EbBbeUcBEJFuAvkwcjR NLLGf82Yw89pJ8cp7T3A5C6Zw+p65pjVLs9tVoPiVsTU0bBwSZdh+G2WscYKgt+HDhUB YWYwI5+GDDttTgBRnGemEkFybaVWTpqWIQVeQ= Original-Received: by 10.14.121.141 with SMTP id r13mr3594992eeh.47.1280917743538; Wed, 04 Aug 2010 03:29:03 -0700 (PDT) Original-Received: from [192.168.1.72] (78-58-76-89.static.zebra.lt [78.58.76.89]) by mx.google.com with ESMTPS id a48sm12526770eei.1.2010.08.04.03.29.02 (version=TLSv1/SSLv3 cipher=RC4-MD5); Wed, 04 Aug 2010 03:29:02 -0700 (PDT) User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.1.11) Gecko/20100701 SeaMonkey/2.0.6 In-Reply-To: <83k4o7xefq.fsf@gnu.org> X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list Resent-Date: Wed, 04 Aug 2010 06:29:02 -0400 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:39231 Archived-At: Eli Zaretskii wrote: >> Laimonas VÄ—bra wrote: >> >>> <...> >> >> Works: >> cmd.exe /c c:/cygwin/bin/ls | grep foo >> cmd.exe /c c:/cygwin/bin/ls | C:\cygwin\bin\grep foo >> cmd.exe /c c:/cygwin/bin/ls | "C:/cygwin/bin/grep" foo >> cmd.exe /c "c:/cygwin/bin/ls" | "C:/cygwin/bin/grep" foo >> >> Fails: >> cmd.exe /c c:/cygwin/bin/ls | C:/cygwin/bin/grep foo > In the case in point, the problem was with the executable _before_ > the pipe. Or with subsequent _slashed_ _and_ _unquoted_ executable(s). Quote whole command line (with slashed programs/paths single quoted): M-x shell-command ""c:/cygwin/bin/ls" | grep foo" M-x shell-command ""c:/cygwin/bin/ls" | "c:/cygwin/bin/grep" foo" or: cmdproxy -c """c:/cygwin/bin/ls" | grep o"" cmdproxy -c """c:/cygwin/bin/ls" | "c:/cygwin/bin/grep" o"" and it _works_. cmd /?: If /C or /K is specified, then the remainder of the command line after the switch is processed as a command line, where the following logic is used to process quote (") characters: 1. If all of the following conditions are met, then quote characters on the command line are preserved: - no /S switch - exactly two quote characters - no special characters between the two quote characters, where special is one of: &<>()@^| - there are one or more whitespace characters between the the two quote characters - the string between the two quote characters is the name of an executable file. 2. Otherwise, old behavior is to see if the first character is a quote character and if so, strip the leading character and remove the last quote character on the command line, preserving any text after the last quote character.