summaryrefslogtreecommitdiff
path: root/libappstream-glib/as-self-test.c
diff options
context:
space:
mode:
Diffstat (limited to 'libappstream-glib/as-self-test.c')
-rw-r--r--libappstream-glib/as-self-test.c13
1 files changed, 5 insertions, 8 deletions
diff --git a/libappstream-glib/as-self-test.c b/libappstream-glib/as-self-test.c
index 6ed3116..47ad937 100644
--- a/libappstream-glib/as-self-test.c
+++ b/libappstream-glib/as-self-test.c
@@ -93,15 +93,12 @@ as_test_get_filename (const gchar *filename)
}
#ifdef _WIN32
{
- DWORD retval;
- TCHAR full_path[PATH_MAX];
-
- retval = GetFullPathNameA (path, PATH_MAX, full_path, NULL);
-
- if (retval > 0)
- return g_strdup (full_path);
- else
+ char full_path[PATH_MAX];
+ if (_fullpath (full_path, path, PATH_MAX) == NULL)
+ return NULL;
+ if (!g_file_test (full_path, G_FILE_TEST_EXISTS))
return NULL;
+ return g_strdup (full_path);
}
#else
return realpath (path, NULL);