diff --git a/src/port/path.c b/src/port/path.c index 13ca4f3f1c1..9cb0b016445 100644 --- a/src/port/path.c +++ b/src/port/path.c @@ -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); }