mirror of
https://github.com/MidnightCommander/mc
synced 2024-12-23 04:46:55 +03:00
1999-03-11 Miguel de Icaza <miguel@nuclecu.unam.mx>
* utilunix.c (g_readlink): Fixed two bugs spotted by Morten Wellinder. Boy, Morten has such a good eye!
This commit is contained in:
parent
cbebd9cd27
commit
307ad5a44d
@ -1,3 +1,8 @@
|
||||
1999-03-11 Miguel de Icaza <miguel@nuclecu.unam.mx>
|
||||
|
||||
* utilunix.c (g_readlink): Fixed two bugs spotted by Morten
|
||||
Wellinder. Boy, Morten has such a good eye!
|
||||
|
||||
1999-03-10 Federico Mena Quintero <federico@nuclecu.unam.mx>
|
||||
|
||||
* file.c (erase_dir): Erase metadata for directories as well.
|
||||
|
@ -962,7 +962,11 @@ g_readlink (char *path)
|
||||
return g_strdup (small_buffer);
|
||||
}
|
||||
|
||||
str = NULL;
|
||||
for (size = 256; size < 8192; size += 128){
|
||||
if (str)
|
||||
g_free (str);
|
||||
|
||||
str = g_malloc (size);
|
||||
|
||||
n = readlink (path, str, size-1);
|
||||
@ -974,12 +978,11 @@ g_readlink (char *path)
|
||||
if (n < size-1){
|
||||
char *s;
|
||||
|
||||
s [n] = 0;
|
||||
str [n] = 0;
|
||||
s = g_strdup (str);
|
||||
g_free (str);
|
||||
return s;
|
||||
}
|
||||
g_free (str);
|
||||
}
|
||||
str [n] = 0;
|
||||
return str;
|
||||
|
Loading…
Reference in New Issue
Block a user