This is the mail archive of the
cygwin
mailing list for the Cygwin project.
RE: Command line processing in dcrt0.cc does not match Microsoft parsing rules
- From: "Stephen Provine via cygwin" <cygwin at cygwin dot com>
- To: "cygwin at cygwin dot com" <cygwin at cygwin dot com>, "Brian dot Inglis at SystematicSw dot ab dot ca" <Brian dot Inglis at SystematicSw dot ab dot ca>
- Date: Wed, 4 Sep 2019 23:46:17 +0000
- Subject: RE: Command line processing in dcrt0.cc does not match Microsoft parsing rules
- Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=microsoft.com; dmarc=pass action=none header.from=microsoft.com; dkim=pass header.d=microsoft.com; arc=none
- Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=4ZTH+/PHwyH1GPlq9EsuWI3m/q3Bww0laIn/CGxrxl4=; b=DsDAMPw29FCFsNdY840s5cYk5G0Ha4arLU1QPUJMdUu98m0VYzBKESnP+yc9sTrBPCXWkTHsjH6jPoJ6Hz3/BhIeRKqa9sW6EBV1QQlhLYcGcHjdp0c9QVFs5Ltxfk7z2jKiRvuU+g1/oEzZz5u7gOyh7wAschBelF8AcFPY8R9A1cKeoc19EaamqWzgu+taPoom8KlXdY52xWldYlM/JJ6bjdzUHJFIJ9TsgrjY+JJG6bCM9wLftLwoYTD1IArB25pD7/5oCFQa6Ga7xxnvn64q9qqBi3rtB9DYe23Fd0y2TypWbpgmxh0dAwqy2LRnMwSkO5Cu7OzSTeQ1dItxqw==
- Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Kjgys8Xvh6j0XgYFPYnfLho12VGCoa1YCRBKyRerO8so+fYyFN268dkkuftoshwNgoJFYX97DnP1KuJcF7JJs0w/ogq3O3zzTwm0ZYPMmx79OcoJJAiOKmvGkyyEIwjZcZ4yksnH29lSWKly9StVphcqrSeGPJCWADgW8PkFu5uP7lv0h4MVIRQpIpUCp+CUTUGDYFjuo/mu53QaUr1sP8TF+mPbis0KTCe6/3Y5QuxekZeCNQIU6yWq7d+ICwhO6W7i9gPLDYM1BwVGKrzUjd8/m/4bt+DhfhIqiawIqjpXETw2/FhY++ONNloV5fF7p9jlXJZ+i5WCMbMU3AA9ZQ==
- References: <MWHPR21MB08452919F35B1B0C5F0EB4DCB9BD0@MWHPR21MB0845.namprd21.prod.outlook.com> <MWHPR21MB0845F78385792965A94E0CD9B9BD0@MWHPR21MB0845.namprd21.prod.outlook.com> <MWHPR21MB084508155AB621C7AD81309CB9B90@MWHPR21MB0845.namprd21.prod.outlook.com>
- Reply-to: Stephen Provine <stephpr at microsoft dot com>
On 2019-09-04 10:20, Brian Inglis wrote:
> and ask if you really expect anyone else to use or reproduce this insanity,
> rather than a sane POSIX parser?
I know it's insanity, but it's insanity that almost all Windows programs inherit and
implement consistently enough because they use standard libraries or functions
to do the parsing. The Go command line parser used to use CommandLineToArgvW
and only switched away from it due to performance (it's in shell32.dll and that takes
a long time to load). I don't know how accurate their manual reproduction is, but
they seemed to study the sources I sent pretty carefully.
Anyway, my specific problem is that I have Go code with an array of arguments that
I want to pass verbatim (no glob expansion) to a bash script. I've figured out how to
override Go's default code for building the command line string, but it's not clear how
to correctly construct the command line string. If the POSIX rules are being followed,
I'd expect the following to work:
bash.exe script.sh arg1 "*" arg3
But it always expands the "*" to all the files in the current directory. I've also tried \* and
'*', but same problem. So how do I build a command line string that takes each argument
literally with no processing?
Thanks,
Stephen
--
Problem reports: http://cygwin.com/problems.html
FAQ: http://cygwin.com/faq/
Documentation: http://cygwin.com/docs.html
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple