projects
/
postgresql.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
dea5f6c
)
Fix join_path_components() to not add a leading slash when joining to an
author
Bruce Momjian
<bruce@momjian.us>
Sat, 26 Nov 2011 14:27:11 +0000
(09:27 -0500)
committer
Bruce Momjian
<bruce@momjian.us>
Sat, 26 Nov 2011 14:27:11 +0000
(09:27 -0500)
initial null string.
Per report from Robert Haas in testing psql \ir.
src/port/path.c
patch
|
blob
|
blame
|
history
diff --git
a/src/port/path.c
b/src/port/path.c
index 13ca4f3f1c1a8d7f69fc1c600cdf3b1f6d9bdc0f..9cb0b016445fa8e17d189994612b01258dbdf529 100644
(file)
--- 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);
}