summaryrefslogtreecommitdiffstats
path: root/src/sysusers
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2019-04-08 12:03:33 +0200
committerLennart Poettering <lennart@poettering.net>2019-04-08 12:03:33 +0200
commite7b88b7bc1b33af3966349ca59ecd3d25c3e8504 (patch)
treed0ebd1d919bca2916a84c89351b77007ad30ec46 /src/sysusers
parentMerge pull request #12238 from keszybz/one-genuine-bugfix+lots-of-line-wrapping (diff)
downloadsystemd-e7b88b7bc1b33af3966349ca59ecd3d25c3e8504.tar.xz
systemd-e7b88b7bc1b33af3966349ca59ecd3d25c3e8504.zip
tree-wide: introduce empty_or_dash() helper
At quite a few places we check isempty() || streq(…, "-"), let's add a helper to simplify that, and replace that by a single function call.
Diffstat (limited to 'src/sysusers')
-rw-r--r--src/sysusers/sysusers.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/sysusers/sysusers.c b/src/sysusers/sysusers.c
index 9a85a20be3..843c3837d1 100644
--- a/src/sysusers/sysusers.c
+++ b/src/sysusers/sysusers.c
@@ -1411,7 +1411,7 @@ static int parse_line(const char *fname, unsigned line, const char *buffer) {
"[%s:%u] Unknown command type '%c'.", fname, line, action[0]);
/* Verify name */
- if (isempty(name) || streq(name, "-"))
+ if (empty_or_dash(name))
name = mfree(name);
if (name) {
@@ -1426,7 +1426,7 @@ static int parse_line(const char *fname, unsigned line, const char *buffer) {
}
/* Verify id */
- if (isempty(id) || streq(id, "-"))
+ if (empty_or_dash(id))
id = mfree(id);
if (id) {
@@ -1437,7 +1437,7 @@ static int parse_line(const char *fname, unsigned line, const char *buffer) {
}
/* Verify description */
- if (isempty(description) || streq(description, "-"))
+ if (empty_or_dash(description))
description = mfree(description);
if (description) {
@@ -1453,7 +1453,7 @@ static int parse_line(const char *fname, unsigned line, const char *buffer) {
}
/* Verify home */
- if (isempty(home) || streq(home, "-"))
+ if (empty_or_dash(home))
home = mfree(home);
if (home) {
@@ -1469,7 +1469,7 @@ static int parse_line(const char *fname, unsigned line, const char *buffer) {
}
/* Verify shell */
- if (isempty(shell) || streq(shell, "-"))
+ if (empty_or_dash(shell))
shell = mfree(shell);
if (shell) {