From a54ac63bbf9b2c71026ac9028a8ffaf186cf3c82 Mon Sep 17 00:00:00 2001 From: Michael Biebl Date: Sun, 28 Jun 2020 18:58:14 +0200 Subject: New upstream version 1.25.90 --- shared/systemd/src/basic/string-util.c | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) (limited to 'shared/systemd/src/basic/string-util.c') diff --git a/shared/systemd/src/basic/string-util.c b/shared/systemd/src/basic/string-util.c index 9f15caca..c30e88c5 100644 --- a/shared/systemd/src/basic/string-util.c +++ b/shared/systemd/src/basic/string-util.c @@ -21,18 +21,19 @@ #include "util.h" int strcmp_ptr(const char *a, const char *b) { - /* Like strcmp(), but tries to make sense of NULL pointers */ + if (a && b) return strcmp(a, b); + return CMP(a, b); /* Direct comparison of pointers, one of which is NULL */ +} - if (!a && b) - return -1; - - if (a && !b) - return 1; +int strcasecmp_ptr(const char *a, const char *b) { + /* Like strcasecmp(), but tries to make sense of NULL pointers */ - return 0; + if (a && b) + return strcasecmp(a, b); + return CMP(a, b); /* Direct comparison of pointers, one of which is NULL */ } char* endswith(const char *s, const char *postfix) { @@ -219,7 +220,6 @@ char *strnappend(const char *s, const char *suffix, size_t b) { return r; } -#if 0 /* NM_IGNORED */ char *strjoin_real(const char *x, ...) { va_list ap; size_t l; @@ -277,6 +277,7 @@ char *strjoin_real(const char *x, ...) { return r; } +#if 0 /* NM_IGNORED */ char *strstrip(char *s) { if (!s) return NULL; -- cgit 1.3.0-6-gf8a5