Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com Message-ID: <431185F7.4040904@arcor.de> Date: Sun, 28 Aug 2005 11:37:59 +0200 From: Mudi Obada User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.11) Gecko/20050728 MIME-Version: 1.0 To: cygwin AT cygwin DOT com Subject: argv[0] parsing problem with -mno-cygwin Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-IsSubscribed: yes Hello, when i compile an application with `gcc -mno-cygwin` and execute it from cmd.exe, argv parsing is broken for argv[0] when quotes are embedded in the command used to launch the application. For example, executing ` "."\argv0_bug "a"\b ` from cmd.exe gives arg0: . arg1: \argv_bug arg2: a\b instead of arg0: .\argv_bug arg1: a\b Note that this is only a problem with argv[0]. MinGW.org's binaries seem to behave as expected. I'm using gcc version 3.4.4 (cygming special) (gdc 0.12, using dmd 0.125). Below is a shell script that demonstrates the problem. Regards, Mudi Obada #-------------------------- #!/bin/sh f=argv0_bug cat <<__EOF__ > $f.c int main(int argc, char * * argv) { int i; for (i = 0; i < argc; i++) { printf("arg%d: %s\n", i, argv[i]); } return 0; } __EOF__ gcc -mno-cygwin $f.c -o $f echo \".\"\\$f \"a\"\\b > ${f}-test.bat cmd /c ${f}-test.bat #-------------------------- -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Problem reports: http://cygwin.com/problems.html Documentation: http://cygwin.com/docs.html FAQ: http://cygwin.com/faq/