661545
From b6f311503a6d8cbca75d1579045ec4bff2d2459a Mon Sep 17 00:00:00 2001
661545
From: Evegeny Vereshchagin <evvers@ya.ru>
661545
Date: Tue, 26 Jun 2018 02:32:44 +0000
661545
Subject: [PATCH] sd-bus: stop using the result of an assignment as an operand
661545
 of &&
661545
661545
This makes OBJECT_PATH_FOREACH_PREFIX consistent with PATH_FOREACH_PREFIX
661545
and also fixes 7 alerts reported by LGTM at
661545
https://lgtm.com/projects/g/systemd/systemd/snapshot/ac0a08700344a5690803df8dd80e8bb5013184a5/files/src/libsystemd/sd-bus/bus-objects.c?sort=name&dir=ASC&mode=heatmap&showExcluded=true#V1383
661545
661545
(cherry picked from commit 283c2653877f2b958045ad99493869fe1a88be95)
661545
661545
Resolves: #1694605
661545
---
661545
 src/libsystemd/sd-bus/bus-internal.h | 2 +-
661545
 1 file changed, 1 insertion(+), 1 deletion(-)
661545
661545
diff --git a/src/libsystemd/sd-bus/bus-internal.h b/src/libsystemd/sd-bus/bus-internal.h
661545
index 1c5fbeac2a..33a5569146 100644
661545
--- a/src/libsystemd/sd-bus/bus-internal.h
661545
+++ b/src/libsystemd/sd-bus/bus-internal.h
661545
@@ -378,7 +378,7 @@ char *bus_address_escape(const char *v);
661545
 
661545
 #define OBJECT_PATH_FOREACH_PREFIX(prefix, path)                        \
661545
         for (char *_slash = ({ strcpy((prefix), (path)); streq((prefix), "/") ? NULL : strrchr((prefix), '/'); }) ; \
661545
-             _slash && !(_slash[(_slash) == (prefix)] = 0);             \
661545
+             _slash && ((_slash[(_slash) == (prefix)] = 0), true);       \
661545
              _slash = streq((prefix), "/") ? NULL : strrchr((prefix), '/'))
661545
 
661545
 /* If we are invoking callbacks of a bus object, ensure unreffing the