delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp-workers/2003/01/30/10:13:12

Sender: rich AT phekda DOT freeserve DOT co DOT uk
Message-ID: <3E3940F9.A66C7217@phekda.freeserve.co.uk>
Date: Thu, 30 Jan 2003 15:12:57 +0000
From: Richard Dawe <rich AT phekda DOT freeserve DOT co DOT uk>
X-Mailer: Mozilla 4.77 [en] (X11; U; Linux 2.2.23 i586)
X-Accept-Language: de,fr
MIME-Version: 1.0
To: djgpp-workers AT delorie DOT com
Subject: Re: Take on __solve_symlinks()
References: <3E286C07 DOT 7040200 AT mif DOT vu DOT lt> <3E2943DA DOT 523770FC AT phekda DOT freeserve DOT co DOT uk> <3E297258 DOT 50906 AT mif DOT vu DOT lt> <3E2A9396 DOT EF36FE73 AT phekda DOT freeserve DOT co DOT uk> <3E305DAB DOT 8090607 AT mif DOT vu DOT lt> <3E305D5A DOT 16693047 AT phekda DOT freeserve DOT co DOT uk> <3E386A1C DOT 9050303 AT mif DOT vu DOT lt>
Reply-To: djgpp-workers AT delorie DOT com

Hello.

Laurynas Biveinis wrote:
[snip]
> Can you set a breakpoint on offending __solve_symlinks call and tell
> contents of both arguments? (i.e. before any _fixpath'ing)

Test 3: Solving c:../../../../../../djgpp.204/tests/libc/compat/unistd/test1

__symlink_path:
"c:../../../../../../djgpp.204/tests/libc/compat/unistd/test1"

__real_path:
""

I have plain CVS, plus these diff below. If I don't the diff below applied,
then it looked like __real_path contained the result of the last
__solve_symlinks call (__symlink_path ending with file1 instead of test1).

Index: xsymlink.c
===================================================================
RCS file: /cvs/djgpp/djgpp/tests/libc/compat/unistd/xsymlink.c,v
retrieving revision 1.5
diff -p -u -3 -r1.5 xsymlink.c
--- xsymlink.c  23 Dec 2002 11:46:10 -0000      1.5
+++ xsymlink.c  30 Jan 2003 15:11:34 -0000
@@ -242,6 +242,9 @@ static int test_success(const int test_n
    char real_fixed[FILENAME_MAX + 1];
    char expect_fixed[FILENAME_MAX + 1];
    char err_buf[50];
+
+   memset(real_name, 0, sizeof(real_name));
+
    if (!__solve_symlinks(slink, real_name))
    {
       sprintf(err_buf, "Test %d failed ", test_num);
@@ -268,6 +271,9 @@ static int test_failure(const int test_n
    char buf[FILENAME_MAX + 1];
    char err_buf[50];
    errno = 0;
+
+   memset(buf, 0, sizeof(buf));
+
    if (__solve_symlinks(slink, buf))
    {
       fprintf(stderr,

Perhaps you could e-mail me your version of the xsymlink.c test sources?

> > Maybe the test "xsymlink" should take a drive specifier. It could then
> > create a cross-drive symlink to any file on that disk. E.g. c:/temp/foo
> > -> d:/whatever.
> 
> BTW, I wonder if we could do something like SUBST does at runtime...

What would you do, if we could?

Bye, Rich =]

-- 
Richard Dawe [ http://www.phekda.freeserve.co.uk/richdawe/ ]

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019