input/archive: use g_path_is_absolute()

.. instead of manually checking pathname[0]=='/'.
g_path_is_absolute() is portable.
This commit is contained in:
Max Kellermann 2009-12-15 21:26:16 +01:00
parent 03427d4eff
commit b12072e6d9

View File

@ -41,7 +41,7 @@ input_archive_open(struct input_stream *is, const char *pathname)
char *archive, *filename, *suffix, *pname; char *archive, *filename, *suffix, *pname;
bool opened; bool opened;
if (pathname[0] != '/') if (!g_path_is_absolute(pathname))
return false; return false;
pname = g_strdup(pathname); pname = g_strdup(pathname);