public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
* Bug in cygpath -a handling of leading ".//"
@ 2016-11-27  1:20 Vadim Zeitlin
  2016-11-28 19:23 ` Corinna Vinschen
  0 siblings, 1 reply; 2+ messages in thread
From: Vadim Zeitlin @ 2016-11-27  1:20 UTC (permalink / raw)
  To: cygwin

[-- Attachment #1: Type: TEXT/PLAIN, Size: 1129 bytes --]

 Hello,

 I seem to have a special talent for finding problems related to the
handling of doubled consecutive slashes in cygpath, as 5 years after
posting my previous bug report on this topic (see
http://sourceware.org/ml/cygwin/2011-06/msg00212.html), I have another one
which is also best shown with an example obtained with the latest Cygwin
2.6.0 version under Windows 7:

	[~]% cd /tmp
	[/tmp]% mkdir dir
	[/tmp]% cd $_
	[/tmp/dir]% cygpath -a ../dir
	/tmp/dir
	[/tmp/dir]% cygpath -a ./../dir
	/tmp/dir
	[/tmp/dir]% cygpath -a .//../dir
	/tmp/dir/dir

The last one is, of course, incorrect, as it should still output /tmp/dir.
Notice that the problem doesn't happen if "-am" or "-aw" is used, only for
"-a" on its own, so it does have a simple workaround: realpath can be used
instead. But I still wanted to report it in the hope that it might at least
help somebody else if they run into it (it took me quite some time to
realize that the bug wasn't in my own makefile but rather in cygpath
itself...).

 Please let me know if you'd like me to provide any further information and
thanks in advance for looking at this,
VZ

[-- Attachment #2: Type: APPLICATION/PGP-SIGNATURE, Size: 196 bytes --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Bug in cygpath -a handling of leading ".//"
  2016-11-27  1:20 Bug in cygpath -a handling of leading ".//" Vadim Zeitlin
@ 2016-11-28 19:23 ` Corinna Vinschen
  0 siblings, 0 replies; 2+ messages in thread
From: Corinna Vinschen @ 2016-11-28 19:23 UTC (permalink / raw)
  To: cygwin

[-- Attachment #1: Type: text/plain, Size: 1636 bytes --]

On Nov 26 02:42, Vadim Zeitlin wrote:
>  Hello,
> 
>  I seem to have a special talent for finding problems related to the
> handling of doubled consecutive slashes in cygpath, as 5 years after
> posting my previous bug report on this topic (see
> http://sourceware.org/ml/cygwin/2011-06/msg00212.html), I have another one
> which is also best shown with an example obtained with the latest Cygwin
> 2.6.0 version under Windows 7:
> 
> 	[~]% cd /tmp
> 	[/tmp]% mkdir dir
> 	[/tmp]% cd $_
> 	[/tmp/dir]% cygpath -a ../dir
> 	/tmp/dir
> 	[/tmp/dir]% cygpath -a ./../dir
> 	/tmp/dir
> 	[/tmp/dir]% cygpath -a .//../dir
> 	/tmp/dir/dir
> 
> The last one is, of course, incorrect, as it should still output /tmp/dir.
> Notice that the problem doesn't happen if "-am" or "-aw" is used, only for
> "-a" on its own, so it does have a simple workaround: realpath can be used
> instead. But I still wanted to report it in the hope that it might at least
> help somebody else if they run into it (it took me quite some time to
> realize that the bug wasn't in my own makefile but rather in cygpath
> itself...).
> 
>  Please let me know if you'd like me to provide any further information and
> thanks in advance for looking at this,

I could easily reproduce the problem and pushed a patch to the repo.  I
uploaded a new developer snapshot to https://cygwin.com/snapshots/,
please give it a try.  I guess a 2.6.1 bugfix release is due soon.


Thanks,
Corinna

-- 
Corinna Vinschen                  Please, send mails regarding Cygwin to
Cygwin Maintainer                 cygwin AT cygwin DOT com
Red Hat

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2016-11-28 12:03 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-11-27  1:20 Bug in cygpath -a handling of leading ".//" Vadim Zeitlin
2016-11-28 19:23 ` Corinna Vinschen

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).