bug-coreutils
[Top][All Lists]
Advanced

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

[PATCH] maint: use more readable operator: "||" rather than "|"


From: Jim Meyering
Subject: [PATCH] maint: use more readable operator: "||" rather than "|"
Date: Tue, 05 Jan 2010 09:11:16 +0100

Here's a new-to-me reason to use "||" rather than "|":

>From dc0f5eb6a01b759c92478be7f21de3e685ebfbca Mon Sep 17 00:00:00 2001
From: Jim Meyering <address@hidden>
Date: Mon, 4 Jan 2010 16:46:44 +0100

* src/cp.c (make_dir_parents_private): Use "||" rather than "|",
so that clang understands there is no undefined pointer dereference.
---
 src/cp.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/cp.c b/src/cp.c
index 980c058..b2a7269 100644
--- a/src/cp.c
+++ b/src/cp.c
@@ -411,8 +411,8 @@ make_dir_parents_private (char const *const_dir, size_t 
src_offset,
           *slash = '\0';
           missing_dir = (stat (dir, &stats) != 0);

-          if (missing_dir | x->preserve_ownership | x->preserve_mode
-              | x->preserve_timestamps)
+          if (missing_dir || x->preserve_ownership || x->preserve_mode
+              || x->preserve_timestamps)
             {
               /* Add this directory to the list of directories whose
                  modes might need fixing later. */
--
1.6.6.384.g14e6a




reply via email to

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