summaryrefslogtreecommitdiffstats
path: root/src/import/import.c
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/import/import.c
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/import/import.c')
-rw-r--r--src/import/import.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/import/import.c b/src/import/import.c
index e3a1ae8a8b..4c9603fbdc 100644
--- a/src/import/import.c
+++ b/src/import/import.c
@@ -49,14 +49,14 @@ static int import_tar(int argc, char *argv[], void *userdata) {
if (argc >= 2)
path = argv[1];
- if (isempty(path) || streq(path, "-"))
+ if (empty_or_dash(path))
path = NULL;
if (argc >= 3)
local = argv[2];
else if (path)
local = basename(path);
- if (isempty(local) || streq(local, "-"))
+ if (empty_or_dash(local))
local = NULL;
if (local) {
@@ -145,14 +145,14 @@ static int import_raw(int argc, char *argv[], void *userdata) {
if (argc >= 2)
path = argv[1];
- if (isempty(path) || streq(path, "-"))
+ if (empty_or_dash(path))
path = NULL;
if (argc >= 3)
local = argv[2];
else if (path)
local = basename(path);
- if (isempty(local) || streq(local, "-"))
+ if (empty_or_dash(local))
local = NULL;
if (local) {