delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2009/06/30/17:11:43

X-Recipient: archive-cygwin AT delorie DOT com
X-SWARE-Spam-Status: No, hits=-2.6 required=5.0 tests=BAYES_00,SPF_PASS
X-Spam-Check-By: sourceware.org
Message-ID: <4A4A7F68.3040306@gmail.com>
Date: Tue, 30 Jun 2009 23:11:04 +0200
From: grischka <gr1008 AT googlemail DOT com>
User-Agent: Thunderbird 1.5.0.10 (Windows/20070221)
MIME-Version: 1.0
To: cygwin AT cygwin DOT com
Subject: commanline argument parsing
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com

If I compile this snippet:

#include <stdio.h>
int main (int argc, char **argv)
{
     int i;
     for (i = 0; i < argc; ++i)
         printf("argv[%d] %s\n", i, argv[i]);
     return 0;
}

with cygwin GCC and then run it from CMD prompt:

     C:\cygwin\home\me> test \"stuff\"

it prints this:

     argv[0] test
     argv[1] \stuff"

Is that expected?  I'm aware that there is some conversion going on
and that it's meant to work from a cygwin shell really, but still.

Could someone shed light upon the reasoning with this?

--- gr

--
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

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019