import: don't apply empty_or_dash_to_null() to stuff we know is NULL anyway

This commit is contained in:
Lennart Poettering
2021-01-22 20:54:51 +01:00
parent 9ae5fed64e
commit 1f5a21324c
+4 -8
View File
@@ -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);