1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
| | --- a/src/c/unixfsys.d 2016-02-25 02:06:19.000000000 -0500
+++ b/src/c/unixfsys.d 2016-10-07 00:50:20.172282246 -0400
@@ -236,15 +236,15 @@ static cl_object
si_readlink(cl_object filename) {
/* Given a filename which is a symlink, this routine returns
* the value of this link in the form of a pathname. */
- cl_index size = 128, written;
+ cl_index size = 0, written;
cl_object output, kind;
do {
+ size += 128;
output = ecl_alloc_adjustable_base_string(size);
ecl_disable_interrupts();
written = readlink((char*)filename->base_string.self,
(char*)output->base_string.self, size);
ecl_enable_interrupts();
- size += 256;
} while (written == size);
output->base_string.self[written] = '\0';
kind = file_kind((char*)output->base_string.self, FALSE);
|