API change for g_get_current_dir() (#59703)

g_get_current_dir() currently returns "/" on failure. This is quite 
broken, since that is also a valid correct return value. I dicusssed this 
a bit woth owen, and we think that the best solution is to add a GError to 
the function. Then we would return NULL and set the GError on error.

The advantage of this is that it breaks the compilation of any code that 
uses this function, whereas just returning NULL on error would cause apps 
to segfault.

This will cause a bit of breakage though, g_get_current_dir() is 
references in about 80 files according to lxr.

Do people have strong opinions on this?

/ Alex

gnome-hackers mailing list
gnome-hackers gnome org

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]