From: Tomas Jura <tomas.jura1@gmail.com>
To: cygwin@cygwin.com
Subject: Re: cygpath and star character
Date: Thu, 15 Jul 2021 01:07:06 +0200 [thread overview]
Message-ID: <435f5a07-98cc-ef48-2188-6289d7a9dd7f@gmail.com> (raw)
In-Reply-To: <c1720bc3-8ea5-b4a4-fb46-599474b51d88@cornell.edu>
Hi
My use case is building the CLASSPATH environment variable for java. Like:
export CLASSPATH="${CLASSPATH}${PATH_SEPARATOR}$(cygpath -w
'my/java/jar/directory/*' )"
CLASSPATH can contain the star character at the end on Windows. Example
C:\Apps\java\lib\* , which means something different then just
C:\Apps\java\lib, ie. the star is necessary there.
Tomas
14. 07. 21 v 21:26 Ken Brown wrote:
> On 7/14/2021 4:10 AM, Tomas Jura via Cygwin wrote:
>> Hi
>>
>> I found a strange behaviour of the program cygpath program
>>
>> 0 >cygpath -w "./*/*" <--- IMHO wrong output
>> \
>>
>> 0 >cygpath -w "./*/*" | od -a <--- a detailed dump
>> 0000000 o nul * \ o nul * nl
>> 0000010
>
> What you're seeing here is a consequence of the way Cygwin handles
> valid POSIX file names that contain characters (like '*') that are not
> allowed in Windows file names. See "Forbidden characters in
> filenames" at
>
> https://cygwin.com/cygwin-ug-net/using-specialnames.html
>
> Internally, Cygwin converts "./*/*" to the wide char string L"*\*"
> with '*' replaced by 0xf02a. This then gets converted to the
> multibyte sequence in your "detailed dump", which is not quite
> detailed enough:
>
> $ cygpath -w "./*/*" | od -b
> 0000000 357 200 252 134 357 200 252 012
> 0000010
>
> I tend to agree that this is not desirable behavior. I doubt if users
> of 'cygpath -w' expect to get a result that contains transformed
> forbidden characters. But maybe there's a use case for this that I'm
> missing. Corinna?
>
>> 0 >cygpath -wp "./*/*" <-- but this works as expected
>> *\*
>>
>> Is this bug or expected behavior ?
>
> It looks to me like a bug that 'cygpath -w' and 'cygpath -wp' give
> different results on a path that doesn't contain a colon.
>
> Ken
next prev parent reply other threads:[~2021-07-14 23:07 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-07-14 8:10 Tomas Jura
2021-07-14 19:26 ` Ken Brown
2021-07-14 23:07 ` Tomas Jura [this message]
2021-07-15 6:18 ` Sam Edge
2021-07-15 9:11 ` Corinna Vinschen
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=435f5a07-98cc-ef48-2188-6289d7a9dd7f@gmail.com \
--to=tomas.jura1@gmail.com \
--cc=cygwin@cygwin.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).