summaryrefslogtreecommitdiffstats
path: root/src/basic/nulstr-util.c
blob: dbafc8c4c94544fc0f1f553d20eba71dac6ca777 (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"

const char* nulstr_get(const char *nulstr, const char *needle) {
        const char *i;

        if (!nulstr)
                return NULL;

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

        return NULL;
}