changeset 16196:c1c37f0242bc

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). The issue was spotted by Eric Blake and is adequately documented in the docs for stat and lstat.
author Pádraig Brady <P@draigBrady.com>
date Fri, 30 Dec 2011 15:36:50 +0000
parents 24c99c1ed829
children 98a6ed2516bf
files ChangeLog lib/canonicalize.c
diffstat 2 files changed, 8 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- 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
--- a/lib/canonicalize.c
+++ b/lib/canonicalize.c
@@ -198,7 +198,7 @@
           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)