Skip to content

Commit 4650036

Browse files
committed
Fix readlink() return value on Windows.
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
1 parent 359d601 commit 4650036

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/port/dirmod.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -359,6 +359,9 @@ pgreadlink(const char *path, char *buf, size_t size)
359359
return -1;
360360
}
361361

362+
/* r includes the null terminator */
363+
r -= 1;
364+
362365
/*
363366
* If the path starts with "\??\", which it will do in most (all?) cases,
364367
* strip those out.

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy