cmd.exe and file name conversion from comman line argument

h_ono@ot.olympus.co.jp h_ono@ot.olympus.co.jp
Fri Jul 27 10:16:00 GMT 2018


> 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

 ТÒÐÐ¥&ö&ÆVÒ&W÷'G3¢‡GG¢òö7–wv–âæ6öÒ÷&ö&ÆV×2æ‡FÖÀФd¢‡GG¢òö7–wv–âæ6öÒöfðФFö7VÖVçFF–ö㢇GG¢òö7–wv–âæ6öÒöFö72æ‡FÖÀÐ¥Vç7V'67&–&R–æfó¢‡GG¢òö7–wv–âæ6öÒöÖÂò7Vç7V'67&–&R×6–×ÆPРÐ


More information about the Cygwin mailing list