On 2022-08-09 22:52, Ken Brown wrote: > I think the best fix is to set res = 0 at the beginning of the loop and > to remove a "res = -1" that occurs later.  I've sent a patch to > cygwin-patches. > > Ken > From https://cygwin.com/pipermail/cygwin-patches/2022q3/011994.html > Currently it is possible for symlink_info::check to return -1 in case > we're searching for foo and find foo.lnk that is not a shortcut. Does it matter that it is *not* a shortcut for this patch to work? I first experienced this issue using an actual shortcut, but simplified the reproduction code. mkshortcut -n Foo.lnk ... -> touch Foo.lnk