mirror of
https://github.com/postgres/postgres.git
synced 2025-04-25 21:42:33 +03:00
Fix join_path_components() to not add a leading slash when joining to an
initial null string. Per report from Robert Haas in testing psql \ir.
This commit is contained in:
parent
dea5f6cefe
commit
fd6dbc24ef
@ -212,7 +212,8 @@ join_path_components(char *ret_path,
|
|||||||
}
|
}
|
||||||
if (*tail)
|
if (*tail)
|
||||||
snprintf(ret_path + strlen(ret_path), MAXPGPATH - strlen(ret_path),
|
snprintf(ret_path + strlen(ret_path), MAXPGPATH - strlen(ret_path),
|
||||||
"/%s", tail);
|
/* only add slash if there is something already in head */
|
||||||
|
"%s%s", head[0] ? "/" : "", tail);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user