bug in cygwin_conv_to_posix_path() caused by period in win32 path

Pavel Kudrna Pavel.Kudrna@mff.cuni.cz
Thu Jul 12 19:03:00 GMT 2007


Christopher Faylor wrote:
> The issue is well understood and there is no
> reason to send more email about this unless the email contains a patch.
>
> cgf
>   
The current isabspath() macro requires an absolute path starting with 
drive letter and colon
to be just drive letter and colon or to be followed by (back)slash.
See \usr\src\cygwin-1.5.24-2\winsup\cygwin\winsup.h:

#define isabspath(p) \
  (isdirsep (*(p)) || (isalpha (*(p)) && (p)[1] == ':' && (!(p)[2] || 
isdirsep ((p)[2]))))

So that c:\, c:, c:\. are abspaths but c:. is not!

I suggest to drop that requirement so that absolute path would start 
with slash,
backslash or drive letter and colon.

#define isabspath(p) \
  ( isdirsep (*(p)) || (isalpha (*(p)) && (p)[1] == ':' ) )

After that change cygwin_conv_to_posix_path() treats all following paths 
in the same
way:
c:\     /cygdrive/c
c:      /cygdrive/c
c:\.\   /cygdrive/c/
c:\.    /cygdrive/c
c:.\    /cygdrive/c/./
c:.     /cygdrive/c/.
Before the suggested change last two items were slashified only.
Pavel Kudrna

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/



More information about the Cygwin mailing list