diff --git a/src/port/path.c b/src/port/path.c
new file mode 100644
index 13ca4f3..9cb0b01
*** a/src/port/path.c
--- b/src/port/path.c
*************** join_path_components(char *ret_path,
*** 212,218 ****
  	}
  	if (*tail)
  		snprintf(ret_path + strlen(ret_path), MAXPGPATH - strlen(ret_path),
! 				 "/%s", tail);
  }
  
  
--- 212,219 ----
  	}
  	if (*tail)
  		snprintf(ret_path + strlen(ret_path), MAXPGPATH - strlen(ret_path),
! 				/* only add slash if there is something already in head */
! 				 "%s%s", head[0] ? "/" : "", tail);
  }
  
  
