mirror of
https://github.com/postgres/postgres.git
synced 2025-06-16 06:01:02 +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:
@ -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);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user