[PATCH] Fix `Bad address` when running `cmd /c [...]`

Takashi Yano takashi.yano@nifty.ne.jp
Sat Oct 22 05:37:09 GMT 2022


On Sat, 22 Oct 2022 10:54:06 +0900
Takashi Yano wrote:
> On Sat, 22 Oct 2022 10:36:39 +0900
> Takashi Yano wrote:
> > On Fri, 21 Oct 2022 23:37:35 +0200 (CEST)
> > Johannes Schindelin wrote:
> > > In 2b4f986e49 (Cygwin: pty: Treat *.bat and *.cmd as a non-cygwin
> > > console app., 2022-07-31), we introduced a bug fix that specifically
> > > looks for a suffix of the command's file name.
> > > 
> > > However, that file name might be set to `NULL`, namely when
> > > `null_app_name == true`, which is the case when we detected a
> > > command-line `cmd /c [...]`.
> > 
> > It seems that this is msys2 specific issue.
> > I also noticed that
> > cmd //c 'echo AAA' instead of cmd /c 'echo AAA' works in msys2.
> > 
> > In cygwin, filename is
> > C:\WINDOWS\system32\cmd.exe
> > for cmd /c 'echo AAA'.
> > 
> > Why the filename can be NULL in msys2 in the case of cmd /c 'echo AAA'?
> 
> I can reproduce the issue in cygwin with cmd.exe /c 'echo AAA'
> instead of cmd /c 'echo AAA'.

I have just pushed a counter patch. Thanks for the report.

-- 
Takashi Yano <takashi.yano@nifty.ne.jp>


More information about the Cygwin-patches mailing list