1
0
mirror of https://github.com/pgbackrest/pgbackrest.git synced 2025-07-13 01:00:23 +02:00

Simplify strIdFrom*() functions.

The strIdFrom*() forced the caller to pick an encoding, which led to a number of TRY...CATCH blocks in the code. In practice the caller does not care which encoding is used as long as the string is valid for some encoding.

Update the strIdFrom*() function to try all possible encodings and only throw an error when the string is not valid for any of them.
This commit is contained in:
David Steele
2021-11-01 10:08:56 -04:00
committed by GitHub
parent a92d793819
commit bc352fa6a8
14 changed files with 107 additions and 132 deletions

View File

@ -172,8 +172,7 @@ testRun(void)
driver.interface.infoList = storageTestPerfInfoList;
Storage *storageTest = storageNew(
strIdFromZ(stringIdBit6, "test"), STRDEF("/"), 0, 0, false, NULL, &driver, driver.interface);
Storage *storageTest = storageNew(strIdFromZ("test"), STRDEF("/"), 0, 0, false, NULL, &driver, driver.interface);
storageHelper.storageRepoWrite = memNew(sizeof(Storage *));
storageHelper.storageRepoWrite[0] = storageTest;