bug-gnu-utils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

How to totally confuse "diff" with softlinks


From: David J. Coffin
Subject: How to totally confuse "diff" with softlinks
Date: Mon, 22 Oct 2001 16:11:46 -0400
User-agent: Mutt/1.2.5i

Hello,

     "diff" mistakes a softlink to "." for a subdirectory
that must be descended, with bizarre results:

        mkdir 1 2
        ln -s . 1/link
        ln -s . 2/link
        diff -r 1 2

     This patch seems to solve the problem, by causing diff
to dismiss soft links as "weird files", and not follow them:

--- diffutils-2.7/diff.c        Thu Sep 22 12:47:00 1994
+++ diffutils-2.7/diff.c        Mon Oct 22 16:12:01 2001
@@ -912,7 +912,7 @@
                }
            }
          else
-           stat_result = stat (inf[i].name, &inf[i].stat);
+           stat_result = lstat (inf[i].name, &inf[i].stat);
 
          if (stat_result != 0)
            {

                                Dave Coffin  10/22/2001
--
David Coffin            Evening: 978-474-7597           42 37'38"N
180 Andover St, Apt 22  Daytime: 781-778-3445           71 09'38"W
Andover, MA 01810-5657  E-mail:  address@hidden 25 meters



reply via email to

[Prev in Thread] Current Thread [Next in Thread]