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.
pull/1/head
Bruce Momjian 14 years ago
parent dea5f6cefe
commit fd6dbc24ef
  1. 3
      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);
}

Loading…
Cancel
Save