Fix a bug where hard links would cause imaginary paths due to not properly cleaning up
authorFabian Groffen <grobian@gentoo.org>
Thu, 10 Apr 2008 12:53:50 +0000 (12:53 -0000)
committerFabian Groffen <grobian@gentoo.org>
Thu, 10 Apr 2008 12:53:50 +0000 (12:53 -0000)
svn path=/main/branches/prefix/; revision=9801

src/chpathtool.c

index 4a2247db9c4c17dee1f48a74717cd66b49442779..f2c92b7bbb3e9fb771ef9e0e67f8fd1f1e2f7e57 100644 (file)
@@ -281,7 +281,10 @@ int dirwalk(char *src, char *srcp, char *trg, char *trgp) {
                                                hl->next = NULL;
                                        } else {
                                                /* don't "copy" the file, we already made a hard
-                                                * link to it */
+                                                * link to it, just restore modified path */
+                                               st = srcp;
+                                               tt = trgp;
+                                               *st = *tt = '\0';
                                                continue;
                                        }
                                }