1
0
mirror of https://github.com/postgres/postgres.git synced 2025-07-15 19:21:59 +03:00

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
This commit is contained in:
Thomas Munro
2022-10-25 15:13:52 +13:00
parent 359d601095
commit 4650036f5a

View File

@ -359,6 +359,9 @@ pgreadlink(const char *path, char *buf, size_t size)
return -1; return -1;
} }
/* r includes the null terminator */
r -= 1;
/* /*
* If the path starts with "\??\", which it will do in most (all?) cases, * If the path starts with "\??\", which it will do in most (all?) cases,
* strip those out. * strip those out.