在 2018/4/17 7:08, Robert Dailey 写道:
> I have been trying to chase down a [bug I found][1] over on the Git
> for Windows project. The short version of the issue is that specifying
> a parameter like "@{-1}" with a git alias gets converted to "@-1".
> Visit link #1 for more detail on that.
> 
> I had started a [discussion over on the MinGW mailing list][2] about
> this and someone found a [bug in glob][3] that was corrected. I had
> reported the specific issue I found [on the MinGW64 project][4] as
> well.
> 
> Could I get the developers of this project to help out here too? To be
> completely honest, I'm not all too familiar with MinGW myself or how
> all of these dependencies tie up together, so I'm relying on help I
> get here to move things forward. I was able to verify this isn't a bug
> with Git, and it's not reproducible on Linux, so I think I've isolated
> it to MinGW.
> 
> Sorry to throw a bunch of URLs at everyone. Let me know if there's
> more I can do. Thanks a bunch.
> 

Using the master branch I wrote a small `echo` utility and failed to
reproduce the problem:

```c
#include <stdio.h>

int main(int argc, char **argv){
        for(int i = 1; i < argc; ++i){
                fputs(argv[i], stdout);
                if(argc - i != 1){
                        putchar(' ');
                }
        }
        putchar('\n');
}
```

Running `a.exe *` in CMD printed a list of all files, but running `a.exe
stash@{0}` merely prints `stash@{0}`.

The globbing feature is not provided by us, but by MSVCRT. You can look
into our source code to tell how we involve `__getmainargs()`, which is
imported from MSVCRT and out of our control. However it does not strip
braces.

MSYS2's 'echo.exe' suffers from this problem, anyway:

```text
C:\Users\lh_mouse>"echo.exe" stash@{-1}
stash@-1
```
But I have no idea what they did to the CRT.

-- 
Best regards,
LH_Mouse
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Mingw-w64-public mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public

Reply via email to