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.
This commit is contained in:
Lennart Poettering
2019-04-08 12:11:11 +02:00
parent e7b88b7bc1
commit dc90e0faae
7 changed files with 32 additions and 50 deletions
+2 -4
View File
@@ -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);