This is the mail archive of the cygwin@cygwin.com mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: strange behavior of cygpath


On Wed, 22 Jan 2003, Kenji Yamashita wrote:

> Hello,
>
> I found that the behavior of cygpath was strange.
>
>   kenji@ibm[88] cygcheck -c cygwin
>   Cygwin Package Information
>   Package             Version
>   cygwin              1.3.18-1
>
>   Use -h to see help about each section
>   kenji@ibm[89] cygpath -pw 'c:\'
>   c;c:\
>
> In cygwin-1.3.14-1, the behavior of cygpath is the following.
>
>   kenji@ibm[93] tar jxf cygwin-1.3.14-1.tar.bz2 usr/bin/cygpath.exe
>   kenji@ibm[94] usr/bin/cygpath.exe -pw 'c:\'
>   c:\
>
> Since cygwin-1.3.15-2, the behavior of cygpath has changed.
>
>   kenji@ibm[95] tar jxf cygwin-1.3.15-2.tar.bz2 usr/bin/cygpath.exe
>   kenji@ibm[96] usr/bin/cygpath.exe -pw 'c:\'
>   c;c:\
>
> In the announcement of cygwin-1.3.15-1,
>   - Fix for "cygpath -w -l returning garbage".
>     (see http://cygwin.com/ml/cygwin/2002-09/msg00749.html )
>     (Christopher Faylor)
>
> Is it related with? and the above is the specification of cygpath?
>
> Regards,
> Kenji Yamashita

Kenji,

Let me make sure I understand what you're trying to do:
You're trying to translate a *Windows* path to a Windows path using
cygpath?

The '-p' flag tells cygpath that the path it's translating is in the form
of Unix $PATH (i.e., directories/files separated by *colons*).  Thus, it's
trying to translate the 2 component Unix path, 'c' followed by '\', into a
Windows %PATH%-style list (directories/files separated by semicolons).
This is correct behavior, and exactly what you're seeing in 1.3.15.  Any
other output is erroneous, and should be treated as such.  1.3.14 cygpath
apparently had a bug.  It's quite possible that the change you mentioned
had the additional benefit of fixing this bug.
	Igor
-- 
				http://cs.nyu.edu/~pechtcha/
      |\      _,,,---,,_		pechtcha@cs.nyu.edu
ZZZzz /,`.-'`'    -.  ;-;;,_		igor@watson.ibm.com
     |,4-  ) )-,_. ,\ (  `'-'		Igor Pechtchanski
    '---''(_/--'  `-'\_) fL	a.k.a JaguaR-R-R-r-r-r-.-.-.  Meow!

Oh, boy, virtual memory! Now I'm gonna make myself a really *big* RAMdisk!
  -- /usr/games/fortune


--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]