teknoraver / rpms / systemd

Forked from rpms/systemd 3 months ago
Clone

Blame SOURCES/0774-sd-bus-stop-using-the-result-of-an-assignment-as-an-.patch

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