#67 CRT argv[0] parsing error (still) a bug?

closed
Earnie Boyd
MinGW (23)
5
2006-02-18
2005-08-25
Mudiaga Obada
No

I'm to lazy to install the latest version of MinGW so
i was wondering if anybody could quickly check on this.

When I compile under Cygwin with

gcc -mno-cygwin -o argv_bug argv_bug.c

the attach program does not behave correctly.

This is wrong:

C:\>"."\argv_bug "a"b x
arg0: .
arg1: \argv_bug
arg2: ab
arg3: x

It should give

C:\>"."\argv_bug "a"b x
arg0: .\argv_bug
arg1: ab
arg2: x

Regards,

Mudiaga Obada

Discussion

  • Mudiaga Obada
    Mudiaga Obada
    2005-08-25

    Logged In: YES
    user_id=223361

    Added correct attachment that demostrates problem

     
  • Mudiaga Obada
    Mudiaga Obada
    2005-08-25

    Sample program with argv[0] error

     
    Attachments
  • Earnie Boyd
    Earnie Boyd
    2005-08-26

    Logged In: YES
    user_id=15438

    I'm too lazy to download your test and compile it. :p

    Are you executing from the Cygwin shell? Does it work
    correctly or differently if you execute from cmd.exe?

    Earnie

     
  • Earnie Boyd
    Earnie Boyd
    2005-08-26

    • milestone: --> Waiting_user_response
    • assigned_to: nobody --> earnie
    • status: open --> pending
     
  • Mudiaga Obada
    Mudiaga Obada
    2005-08-27

    • status: pending --> open
     
  • Mudiaga Obada
    Mudiaga Obada
    2005-08-27

    Logged In: YES
    user_id=223361

    good one with being lazy...

    Well, then use the last program you compiled that processes
    argv,
    And start it with with a part of argv 0 quoted from CMD.exe

    e.g.: C:\> c:\"yourdir"\yourapp.exe --help

    O... since i already downloaded msysDTK-1.0.1.exe before i
    gave up, i might as well test it with one of the tools it it.

    C:\msys\1.0\bin>"."\perl -e 'print "hello"'

    works fine!

    So the problem is/was only with cygwin's gcc -mno-cygwin ?
    Or is it newer that 1.0.1.

    If so, I can pass it on to the cygwin folks...

     
  • Earnie Boyd
    Earnie Boyd
    2006-01-18

    Logged In: YES
    user_id=15438

    Do you still see an issue?

     
  • Earnie Boyd
    Earnie Boyd
    2006-01-18

    • status: open --> pending
     
    • status: pending --> closed
     
  • Logged In: YES
    user_id=1312539

    This Tracker item was closed automatically by the system. It was
    previously set to a Pending status, and the original submitter
    did not respond within 30 days (the time period specified by
    the administrator of this Tracker).