Symlink targets dereferenced when winsymlinks:native

David Macek david.macek.0@gmail.com
Sun Nov 29 14:10:00 GMT 2015


On 26. 11. 2015 12:53, Corinna Vinschen wrote:
> On Nov 24 20:51, David Macek wrote:
>> My test command is `touch 1 && ln -s 1 2`, then I clean up by `rm 1 2`. Now the results:
>>
>> in /bin/: relative
>> in /: absolute
>> in ~/ (/cygdrive/c/Users/username/): relative
>> in /cygdrive/w/: absolute
>>
>> Note that W: is a permasubst (created using `DOSDevices` in registry), which would explain the different behaviour (but not excuse it :), but I don't see why / is also special. Even if only one from the link pair (target or source) is in a relative-symlink-unsupporting path, I get an absolute path.
>>
>> Can you confirm?
> 
> Yes, thanks for this part of the analysis.  There was a typo in the
> code checking the relative paths.  The check for a drive colon in the
> pathname used a wrong offset into the path string, which ultimately
> always created an absolut path to the target if the path of the
> target was in a drive's root dir or one level below that.
> 
> I fixed that in the repo and created a new developer snapshot for
> testing: https://cygwin.com/snapshots/  Please give it a try.

I get relative symlinks in all of my test cases now. Thanks.

-- 
David Macek

-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 4254 bytes
Desc: S/MIME Cryptographic Signature
URL: <http://cygwin.com/pipermail/cygwin/attachments/20151129/0d5029f3/attachment.p7s>


More information about the Cygwin mailing list