This is the mail archive of the
cygwin
mailing list for the Cygwin project.
Re: cmd.exe and file name conversion from comman line argument
> From: Hiroo Ono/jp/olympus@olympus
> To: cygwin@cygwin.com
> Date: 2018/07/27 15:57
> Subject: Re: cmd.exe and file name conversion from comman line argument
> Sent by: cygwin-owner@cygwin.com
>
> c:\cygwin\home\hiroo> touch "あああ"
>
> gives
>
> c:\cygwin\home\hiroo> ls
> '"あああ"'
It may be related to build_argv() in
https://github.com/mirror/newlib-cygwin/blob/master/winsup/cygwin/dcrt0.cc
line 320 to 328:
/* Skip over characters until the closing quote */
{
sawquote = cmd;
/* Handle quoting. Only strip off quotes if the parent is
a Cygwin process, or if the word starts with a '@'.
In this case, the insert_file function needs an unquoted
DOS filename and globbing isn't performed anyway. */
cmd = quoted (cmd, winshell && argc > 0 && *word != '@');
}
As the comment says,
c:\cygwin\home\hiroo> touch @"あああ"
gives file named @あああ.
---------
Hiroo Ono