Make utils_is_absolute_path() a NULL-safe version of

g_path_is_absolute().


git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@2528 ea778897-0a13-0410-b9d1-a72fbfd435f5
This commit is contained in:
Nick Treleaven 2008-04-25 11:50:48 +00:00
parent 3ce268801a
commit 57243c3859
2 changed files with 5 additions and 8 deletions

View File

@ -2,6 +2,9 @@
* src/document.c:
Add/reorder a recent file item when closing a document.
* src/utils.c:
Make utils_is_absolute_path() a NULL-safe version of
g_path_is_absolute().
2008-04-24 Enrico Tröger <enrico(dot)troeger(at)uvena(dot)de>

View File

@ -677,19 +677,13 @@ gboolean utils_atob(const gchar *str)
}
/* NULL-safe version of g_path_is_absolute(). */
gboolean utils_is_absolute_path(const gchar *path)
{
if (! path || *path == '\0')
return FALSE;
#ifdef G_OS_WIN32
if (path[0] == '\\' || path[1] == ':')
return TRUE;
#else
if (path[0] == '/')
return TRUE;
#endif
return FALSE;
return g_path_is_absolute(path);
}