1
0
mirror of https://github.com/pgbackrest/pgbackrest.git synced 2025-01-18 04:58:51 +02:00

Handle NULL path in TEST_STORAGE_LIST when remove is specified.

Using the path variable directly resulted in a path with (null) in it, which caused the remove to fail.

The pathFull variable already exists for this purpose so use it.
This commit is contained in:
David Steele 2022-04-08 11:07:26 -04:00
parent 571dceefec
commit 4f543a4d67

View File

@ -301,11 +301,11 @@ hrnStorageList(const Storage *const storage, const char *const path, const char
if (info->type == storageTypePath)
{
storagePathRemoveP(
storage, strNewFmt("%s/%s", path, strZ(info->name)), .errorOnMissing = true, .recurse = true);
storage, strNewFmt("%s/%s", strZ(pathFull), strZ(info->name)), .errorOnMissing = true, .recurse = true);
}
// Remove file, link, or special
else
storageRemoveP(storage, strNewFmt("%s/%s", path, strZ(info->name)), .errorOnMissing = true);
storageRemoveP(storage, strNewFmt("%s/%s", strZ(pathFull), strZ(info->name)), .errorOnMissing = true);
}
}
}