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:
Miguel de Icaza 1999-03-11 18:43:11 +00:00
parent cbebd9cd27
commit 307ad5a44d
2 changed files with 10 additions and 2 deletions

View File

@ -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.

View File

@ -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;