diff options
author | Přemysl Eric Janouch <p@janouch.name> | 2022-07-21 09:50:43 +0200 |
---|---|---|
committer | Přemysl Eric Janouch <p@janouch.name> | 2022-07-21 09:57:00 +0200 |
commit | 60b2395940b2e4fa0d8a62c17d51ca286e445b09 (patch) | |
tree | ba313bf9530df67d52f3b3c93809e7cbf05130f3 | |
parent | e7c75f8f9b384afa6f5bdf519391070187e11b3a (diff) | |
download | fiv-60b2395940b2e4fa0d8a62c17d51ca286e445b09.tar.gz fiv-60b2395940b2e4fa0d8a62c17d51ca286e445b09.tar.xz fiv-60b2395940b2e4fa0d8a62c17d51ca286e445b09.zip |
Mildly improve Windows portability
-rw-r--r-- | xdg.c | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -45,7 +45,7 @@ char * get_xdg_home_dir(const char *var, const char *default_) { const char *env = getenv(var); - if (env && *env == '/') + if (env && g_path_is_absolute(env)) return g_strdup(env); // The specification doesn't handle a missing HOME variable explicitly. @@ -65,9 +65,9 @@ get_xdg_data_dirs(void) if (!(xdg_data_dirs = getenv("XDG_DATA_DIRS")) || !*xdg_data_dirs) xdg_data_dirs = "/usr/local/share/:/usr/share/"; - gchar **candidates = g_strsplit(xdg_data_dirs, ":", 0); + gchar **candidates = g_strsplit(xdg_data_dirs, G_SEARCHPATH_SEPARATOR_S, 0); for (gchar **p = candidates; *p; p++) { - if (**p == '/') + if (g_path_is_absolute(*p)) g_ptr_array_add(output, *p); else g_free(*p); |