summaryrefslogtreecommitdiff
path: root/src/basic/nulstr-util.c
blob: 49fcbb0f03cefa49ff8f393a1f1681471910c1d2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
/* SPDX-License-Identifier: LGPL-2.1-or-later */

#include "nulstr-util.h"
#include "string-util.h"

bool nulstr_contains(const char *nulstr, const char *needle) {
        const char *i;

        if (!nulstr)
                return false;

        NULSTR_FOREACH(i, nulstr)
                if (streq(i, needle))
                        return true;

        return false;
}