Greetings.

No compiler has any business rejecting files for the sole crime of being
symlinked to.  The following applies, modulo patch fuzz, to the 9, 10 and 11
series of compilers.

Given my use of shadow trees, this bug attempted to prevent me from building
12.1.0.  The D-based gdc in 12.1.0 and up does not exhibit this quirky
behaviour.

Please Reply-To-All.

Thanks and have a great day.

Marc.

Signed-off-by: Marc Aurèle La France <t...@tuyoix.net>

diff -aNpRruz -X /etc/diff.excludes gcc-11.3.0/gcc/d/dmd/root/filename.c 
devel-11.3.0/gcc/d/dmd/root/filename.c
--- gcc-11.3.0/gcc/d/dmd/root/filename.c        2022-04-21 01:58:53.151586473 
-0600
+++ devel-11.3.0/gcc/d/dmd/root/filename.c      2022-05-11 16:30:54.398488793 
-0600
@@ -522,7 +522,7 @@ const char *FileName::safeSearchPath(Strings *path, const 
char *name)
             //      "strncmp(cpath, cname, %i)=%i\n", exists(cname),
             //      strlen(cpath), strncmp(cpath, cname, strlen(cpath)));
             // exists and name is *really* a "child" of path
-            if (exists(cname) && strncmp(cpath, cname, strlen(cpath)) == 0)
+            if (exists(cname))
             {
                 ::free(const_cast<char *>(cpath));
                 const char *p = mem.xstrdup(cname);

Reply via email to