mirror of
https://git.postgresql.org/git/postgresql.git
synced 2025-03-07 19:47:50 +08: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)
|
||||
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…
Reference in New Issue
Block a user