summaryrefslogtreecommitdiffstats
path: root/src/import/import-fs.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2019-04-08 12:11:11 +0200
committerLennart Poettering <lennart@poettering.net>2019-04-08 12:11:11 +0200
commitdc90e0faae63a26a3e7aa4d285a50b1efb1ae39a (patch)
tree115168bfde588f513d92da56cbf0abc9ecf26d5a /src/import/import-fs.c
parenttree-wide: introduce empty_or_dash() helper (diff)
downloadsystemd-dc90e0faae63a26a3e7aa4d285a50b1efb1ae39a.tar.xz
systemd-dc90e0faae63a26a3e7aa4d285a50b1efb1ae39a.zip
basic: add new helper call empty_or_dash_to_null()
We have a function like this at two places already. Let's unify it in one generic location and let's port a number of users over.
Diffstat (limited to 'src/import/import-fs.c')
-rw-r--r--src/import/import-fs.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/src/import/import-fs.c b/src/import/import-fs.c
index 9f3ef0826c..04344492c8 100644
--- a/src/import/import-fs.c
+++ b/src/import/import-fs.c
@@ -117,15 +117,13 @@ static int import_fs(int argc, char *argv[], void *userdata) {
if (argc >= 2)
path = argv[1];
- if (empty_or_dash(path))
- path = NULL;
+ path = empty_or_dash_to_null(path);
if (argc >= 3)
local = argv[2];
else if (path)
local = basename(path);
- if (empty_or_dash(local))
- local = NULL;
+ local = empty_or_dash_to_null(local);
if (local) {
if (!machine_name_is_valid(local)) {