#433 convert single hypen command line arg

msys (22)

Three patches against msysCORE-1.0.11-msys-1.0.11-base-src.tar.lzma.

1. comment.diff: Just adds a few comments to the msys_p2w function.
2. hyphen-convert.diff: Check for end-of-string before "/" for an argument beginning with "-"
3. spawn-leak.diff: I believe this would fix a memory leak I noticed with the msys_p2w return value

A test case that shows the problem I am fixing on three Windows XP computers I have tried, is to do:
bash -c "cmd.exe //c echo eighteen-char-word/ -"

Incorrect output:
eighteen-char-word/ -H:/msys/1.0

Expected output when fixed:
eighteen-char-word/ -

I found there's already a bug opened for this issue: 1249827 "msys appending Win32 path to hyphen". But I couldn't find a way to attach my fix, so I'm opening this one.


  • Cesar Strauss

    Cesar Strauss - 2010-01-02
    • assigned_to: earnie --> cstrauss
  • Martin Panter

    Martin Panter - 2011-03-20

    The bug got fixed based on my changes ages ago. Not sure on that spawn leak bit though.

  • Martin Panter

    Martin Panter - 2011-03-20
    • status: open --> closed-fixed
  • Cesar Strauss

    Cesar Strauss - 2011-03-22

    > The bug got fixed based on my changes ages ago.

    Indeed. Thanks for tracking down the bug and supplying a fix.

    > Not sure on that spawn leak bit though.

    I'll take another look.


  • Martin Panter

    Martin Panter - 2011-03-22

    Note that haven't used Windows or Mingw for a long time now. But anyway I just had a quick look at my spawn-leak patch and the msys_p2w function and I suspect there might be more leakage inside the msys_p2w function, for instance the first "return ((char *)path)" line appears to have forgotten about the mallocked retpath.


Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

No, thanks