mirror of
https://github.com/postgrespro/pg_probackup.git
synced 2025-01-06 13:26:28 +02:00
another fix for tablespace_map parsing
This commit is contained in:
parent
ac1e9a7da9
commit
7a464232ed
14
src/dir.c
14
src/dir.c
@ -1150,12 +1150,22 @@ read_tablespace_map(parray *links, const char *backup_dir)
|
||||
while (fgets(buf, lengthof(buf), fp))
|
||||
{
|
||||
char link_name[MAXPGPATH];
|
||||
char path[MAXPGPATH];
|
||||
char *path;
|
||||
int n = 0;
|
||||
pgFile *file;
|
||||
int i = 0;
|
||||
|
||||
if (sscanf(buf, "%s %s", link_name, path) != 2)
|
||||
if (sscanf(buf, "%s %n", link_name, &n) != 1)
|
||||
elog(ERROR, "invalid format found in \"%s\"", map_path);
|
||||
|
||||
path = buf + n;
|
||||
|
||||
/* remove '\n' */
|
||||
i = strlen(path) - 1;
|
||||
path[i] = '\0';
|
||||
|
||||
elog(INFO, "STR: '%s'", path);
|
||||
|
||||
file = pgut_new(pgFile);
|
||||
memset(file, 0, sizeof(pgFile));
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user