]> Savannah Git Hosting - gnulib.git/commitdiff
canonicalize: fix references to stat() and lstat()
authorPádraig Brady <P@draigBrady.com>
Fri, 30 Dec 2011 15:36:50 +0000 (15:36 +0000)
committerPádraig Brady <P@draigBrady.com>
Fri, 30 Dec 2011 15:38:50 +0000 (15:38 +0000)
* lib/canonicalize.c (canonicalize_filename_mode):
Ensure references always resolve to a replacement
function if required (even via a macro).

The issue was spotted by Eric Blake and is
adequately documented in the docs for stat and lstat.

ChangeLog
lib/canonicalize.c

index e61be47ebb43828cbff02cbdf6892902dab2b45f..ff9c84a3a299957a49456eefacf319faed9b411f 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2011-12-30  Pádraig Brady  <P@draigBrady.com>
+
+       canonicalize: fix references to stat() and lstat()
+       * lib/canonicalize.c (canonicalize_filename_mode):
+       Ensure references always resolve to a replacement
+       function if required (even via a macro).
+
 2011-12-30  Jim Meyering  <meyering@redhat.com>
 
        gitlog-to-changelog: remove a little duplication
index a5c9cb4a5853af084470f4e5b558e58eec506caa..e84c3392ed36feac5fa56864440d561c06fea82c 100644 (file)
@@ -198,7 +198,7 @@ canonicalize_filename_mode (const char *name, canonicalize_mode_t can_mode)
           dest += end - start;
           *dest = '\0';
 
-          if ((logical ? stat : lstat) (rname, &st) != 0)
+          if ((logical ? stat (rname, &st) : lstat (rname, &st)) != 0)
             {
               saved_errno = errno;
               if (can_mode == CAN_EXISTING)