diff options
author | Lennart Poettering <lennart@poettering.net> | 2019-04-08 12:11:11 +0200 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2019-04-08 12:11:11 +0200 |
commit | dc90e0faae63a26a3e7aa4d285a50b1efb1ae39a (patch) | |
tree | 115168bfde588f513d92da56cbf0abc9ecf26d5a /src/import/pull.c | |
parent | e7b88b7bc1b33af3966349ca59ecd3d25c3e8504 (diff) | |
download | systemd-dc90e0faae63a26a3e7aa4d285a50b1efb1ae39a.tar.gz |
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/pull.c')
-rw-r--r-- | src/import/pull.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/src/import/pull.c b/src/import/pull.c index 6342f7d7f1..7e8712493f 100644 --- a/src/import/pull.c +++ b/src/import/pull.c @@ -64,8 +64,7 @@ static int pull_tar(int argc, char *argv[], void *userdata) { local = l; } - if (empty_or_dash(local)) - local = NULL; + local = empty_or_dash_to_null(local); if (local) { r = tar_strip_suffixes(local, &ll); @@ -151,8 +150,7 @@ static int pull_raw(int argc, char *argv[], void *userdata) { local = l; } - if (empty_or_dash(local)) - local = NULL; + local = empty_or_dash_to_null(local); if (local) { r = raw_strip_suffixes(local, &ll); |