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:
parent
3ce268801a
commit
57243c3859
@ -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>
|
||||
|
10
src/utils.c
10
src/utils.c
@ -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);
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user