Mail Archives: djgpp-workers/1999/08/25/08:25:31
On Sun, 22 Aug 1999, Laurynas Biveinis wrote:
> if (strnicmp (src_abs, dest_abs, src_base - src_abs))
>
> This test fails if e.g. source is "c:\command.com"
> and destination is "c:\dir\command.com", because
> src_base - src_abs gives 3, so only "c:\" from both
> strings are compared, which gives incorrect result.
Thanks for spotting this. Here's the patch I checked in today:
*** src/libc/posix/unistd/symlink.c~0 Tue Oct 28 21:22:54 1997
--- src/libc/posix/unistd/symlink.c Tue Aug 24 15:47:42 1999
*************** symlink (const char *source, const char
*** 74,80 ****
dest_base = tail (dest_abs);
/* DJGPP symlinks must be in the same directory. */
! if (strnicmp (src_abs, dest_abs, src_base - src_abs))
{
errno = EXDEV;
return -1;
--- 74,81 ----
dest_base = tail (dest_abs);
/* DJGPP symlinks must be in the same directory. */
! if (src_base - src_abs != dest_base - dest_abs
! || strnicmp (src_abs, dest_abs, src_base - src_abs))
{
errno = EXDEV;
return -1;
- Raw text -