From 30e28acfb3b661218db67a82b20018a926dcd946 Mon Sep 17 00:00:00 2001 From: Themaister Date: Thu, 5 Jan 2012 23:09:52 +0100 Subject: [PATCH] Workaround GetFullPathName not existing on XDK. --- conf/config_file.c | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/conf/config_file.c b/conf/config_file.c index 8884364712..ef805367ce 100644 --- a/conf/config_file.c +++ b/conf/config_file.c @@ -204,23 +204,25 @@ static void add_sub_conf(config_file_t *conf, char *line) if (is_full_path) strlcpy(real_path, path, sizeof(real_path)); else - GetFullPathName(path, sizeof(real_path), real_path, NULL); - - if (strcmp(path, real_path) != 0) { - strlcpy(real_path, conf->path, sizeof(real_path)); - char *split = strrchr(real_path, '/'); - if (!split) - split = strrchr(real_path, '\\'); + // Workaround GetFullPathName not existing on XDK. + // : is not a valid element in a path name. (NTFS streams?) + if (strchr(path, ':') == NULL) + { + strlcpy(real_path, conf->path, sizeof(real_path)); + char *split = strrchr(real_path, '/'); + if (!split) + split = strrchr(real_path, '\\'); - split[1] = '\0'; - strlcat(real_path, path, sizeof(real_path)); + split[1] = '\0'; + strlcat(real_path, path, sizeof(real_path)); + } + else + strlcpy(real_path, path, sizeof(real_path)); } #else if (*path == '/') - { strlcpy(real_path, path, sizeof(real_path)); - } #ifndef __CELLOS_LV2__ else if (*path == '~') {