From 83d7371a65a6f805956fb34f0321bff6b4dc7955 Mon Sep 17 00:00:00 2001 From: =?utf8?q?P=C3=A1draig=20Brady?= Date: Fri, 30 Dec 2011 15:36:50 +0000 Subject: [PATCH] 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. --- ChangeLog | 7 +++++++ lib/canonicalize.c | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index e61be47eb..ff9c84a3a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2011-12-30 Pádraig Brady + + 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 gitlog-to-changelog: remove a little duplication diff --git a/lib/canonicalize.c b/lib/canonicalize.c index a5c9cb4a5..e84c3392e 100644 --- a/lib/canonicalize.c +++ b/lib/canonicalize.c @@ -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) -- 2.11.0