projects
/
users
/
gsingh
/
postgres.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
359d601
)
Fix readlink() return value on Windows.
author
Thomas Munro
<
[email protected]
>
Tue, 25 Oct 2022 02:13:52 +0000
(15:13 +1300)
committer
Thomas Munro
<
[email protected]
>
Tue, 25 Oct 2022 02:13:52 +0000
(15:13 +1300)
Ancient bug noticed while working on a test suite for these functions.
Discussion: https://postgr.es/m/CA%2BhUKG%2BajSQ_8eu2AogTncOnZ5me2D-Cn66iN_-wZnRjLN%2Bicg%40mail.gmail.com
src/port/dirmod.c
patch
|
blob
|
blame
|
history
diff --git
a/src/port/dirmod.c
b/src/port/dirmod.c
index 51c9bded8fb2a749c2ff41da3d6f75524731dcf7..398787360a2b642a4d8dc1f2a60b0b1af317022d 100644
(file)
--- a/
src/port/dirmod.c
+++ b/
src/port/dirmod.c
@@
-359,6
+359,9
@@
pgreadlink(const char *path, char *buf, size_t size)
return -1;
}
+ /* r includes the null terminator */
+ r -= 1;
+
/*
* If the path starts with "\??\", which it will do in most (all?) cases,
* strip those out.