Eric Blake wrote:
or fix the ISFOUND() macro to guarantee bool
output to begin with.

Thanks, that sounds like a good idea; I installed the attached patch.
>From 31b024bd0b53f3c3542a485268c3c1fc398e7a4c Mon Sep 17 00:00:00 2001
From: Paul Eggert <[email protected]>
Date: Thu, 11 Dec 2014 19:01:57 -0800
Subject: [PATCH] tar: port ISFOUND, WASFOUND to C89

Problem reported by Romano Maspero in:
http://lists.gnu.org/archive/html/bug-tar/2014-12/msg00010.html
* src/common.h (ISFOUND, WASFOUND): Port to C89.
---
 src/common.h | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/src/common.h b/src/common.h
index 3cc2011..20cbb64 100644
--- a/src/common.h
+++ b/src/common.h
@@ -748,10 +748,12 @@ bool is_avoided_name (char const *name);
 
 bool contains_dot_dot (char const *name);
 
-#define ISFOUND(c) ((occurrence_option == 0) ? (c)->found_count : \
-                    (c)->found_count == occurrence_option)
-#define WASFOUND(c) ((occurrence_option == 0) ? (c)->found_count : \
-                     (c)->found_count >= occurrence_option)
+#define ISFOUND(c) (occurrence_option == 0			\
+		    ? (c)->found_count != 0			\
+		    : (c)->found_count == occurrence_option)
+#define WASFOUND(c) (occurrence_option == 0			\
+		     ? (c)->found_count != 0			\
+		     : (c)->found_count >= occurrence_option)
 
 /* Module tar.c.  */
 
-- 
1.9.3

Reply via email to