From 1f5a21324cec54aaee5427edd3bb876c08fc0bf7 Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Fri, 22 Jan 2021 16:47:22 +0100 Subject: [PATCH] import: don't apply empty_or_dash_to_null() to stuff we know is NULL anyway --- src/import/import.c | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/src/import/import.c b/src/import/import.c index 3fd99d1160..d358eec49c 100644 --- a/src/import/import.c +++ b/src/import/import.c @@ -48,14 +48,12 @@ static int import_tar(int argc, char *argv[], void *userdata) { int r, fd; if (argc >= 2) - path = argv[1]; - path = empty_or_dash_to_null(path); + path = empty_or_dash_to_null(argv[1]); if (argc >= 3) - local = argv[2]; + local = empty_or_dash_to_null(argv[2]); else if (path) local = basename(path); - local = empty_or_dash_to_null(local); if (local) { r = tar_strip_suffixes(local, &ll); @@ -143,14 +141,12 @@ static int import_raw(int argc, char *argv[], void *userdata) { int r, fd; if (argc >= 2) - path = argv[1]; - path = empty_or_dash_to_null(path); + path = empty_or_dash_to_null(argv[1]); if (argc >= 3) - local = argv[2]; + local = empty_or_dash_to_null(argv[2]); else if (path) local = basename(path); - local = empty_or_dash_to_null(local); if (local) { r = raw_strip_suffixes(local, &ll); -- 2.25.1