Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
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)