From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Ben Key Newsgroups: gmane.emacs.devel Subject: Re: Fixing Windows and DOS command line argument quoting Date: Tue, 26 Apr 2011 19:58:49 -0500 Message-ID: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=0016e6d77df6bc0a7904a1dbf253 X-Trace: dough.gmane.org 1303865959 28880 80.91.229.12 (27 Apr 2011 00:59:19 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Wed, 27 Apr 2011 00:59:19 +0000 (UTC) To: Emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Apr 27 02:59:15 2011 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([140.186.70.17]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1QEt62-0006P9-BA for ged-emacs-devel@m.gmane.org; Wed, 27 Apr 2011 02:59:14 +0200 Original-Received: from localhost ([::1]:38693 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QEt61-0004ul-Vd for ged-emacs-devel@m.gmane.org; Tue, 26 Apr 2011 20:59:13 -0400 Original-Received: from eggs.gnu.org ([140.186.70.92]:41253) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QEt5z-0004uf-8P for Emacs-devel@gnu.org; Tue, 26 Apr 2011 20:59:12 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QEt5y-00007g-Bv for Emacs-devel@gnu.org; Tue, 26 Apr 2011 20:59:11 -0400 Original-Received: from mail-bw0-f41.google.com ([209.85.214.41]:51889) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QEt5y-00007c-5q for Emacs-devel@gnu.org; Tue, 26 Apr 2011 20:59:10 -0400 Original-Received: by bwz17 with SMTP id 17so1255270bwz.0 for ; Tue, 26 Apr 2011 17:59:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:from:date:message-id:subject:to :content-type; bh=2z9O/ipkFp2f+GqB7GE/FlBCxyrf9Al56V9vZqNHxDk=; b=NClHpFsmKuz6ePj+XWgTyXNi5qGzAVhj8HYSPlncvMquGemPESoGbBP1rmBMwtcxO6 uDDcqF+zqk/yleBq75pzQfKQUPrhVrCDGOFFq7ULff7T44GaQ/r+kNW98NlU/h/1Ispd 3lEFArO6CJsqH9Kmm86OaVL9+iLhArr8WzH4g= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:from:date:message-id:subject:to:content-type; b=HmFI2PeHWoUDFsY96F4ThTS8lvr4xx9PYOW+Lom+Bx+27EyF3RZvMe+UZhMF7WEZUc z2CDPEn0DN4AZDGzlnQD5ZtBqFlRrCYYdNNP75PvFLSLIMiTf0nwMA6FwBhMIUjf3Fcs vSP30gUyKvU7HeXot/ef7TYaE7IaXaWcoN4q8= Original-Received: by 10.204.75.23 with SMTP id w23mr1367186bkj.200.1303865949161; Tue, 26 Apr 2011 17:59:09 -0700 (PDT) Original-Received: by 10.204.126.85 with HTTP; Tue, 26 Apr 2011 17:58:49 -0700 (PDT) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-Received-From: 209.85.214.41 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:138819 Archived-At: --0016e6d77df6bc0a7904a1dbf253 Content-Type: text/plain; charset=ISO-8859-1 Daniel Colascione writes: > After another reading of cmdproxy.c, I also see that the > CreateProcess path also doesn't expand environment %variable% > references, and that doesn't fall back to cmd if the command > to be executed contains them. While we could expand these > variables, doing so would move us even closer to > reimplementing half of cmd.exe. You are exaggerating a great deal. It is a single function call, ExpandEnvironmentStrings, documented at http://msdn.microsoft.com/en-us/library/ms724265%28v=vs.85%29.aspx. Patching cmdproxy.c to use ExpandEnvironmentStrings before calling CreateProcess would add at most 10 lines of code. This is by no means "reimplementing half of cmd.exe." --0016e6d77df6bc0a7904a1dbf253 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Daniel Colascione writes:

> After another reading of cmdproxy.c, = I also see that the
> CreateProcess path also doesn't expand envi= ronment %variable%
> references, and that doesn't fall back to cm= d if the command
> to be executed contains them.=A0 While we could expand these
> v= ariables, doing so would move us even closer to
> reimplementing half= of cmd.exe.

You are exaggerating a great deal.=A0 It is a single fu= nction call, ExpandEnvironmentStrings, documented at http://msdn.micr= osoft.com/en-us/library/ms724265%28v=3Dvs.85%29.aspx.=A0 Patching cmdpr= oxy.c to use ExpandEnvironmentStrings before calling CreateProcess would ad= d at most 10 lines of code.=A0 This is by no means "reimplementing hal= f of cmd.exe."

--0016e6d77df6bc0a7904a1dbf253--