X-Git-Url: http://git.efficios.com/?a=blobdiff_plain;f=common%2Fcommon.c;h=363ffe2da5725e031954edc75f8c0d3928640ae2;hb=be3c4e36fab9415c72a000036e37442406a02702;hp=0a0d15836e329d866c40286ded145f209d671b2e;hpb=1e5aee0ff3b06da1c120a39c0b157f20522846a6;p=babeltrace.git diff --git a/common/common.c b/common/common.c index 0a0d1583..363ffe2d 100644 --- a/common/common.c +++ b/common/common.c @@ -201,19 +201,19 @@ int bt_common_append_plugin_path_dirs(const char *paths, GPtrArray *dirs) while (at < end) { GString *path; - const char *next_colon; + const char *next_sep; - next_colon = strchr(at, ':'); - if (next_colon == at) { + next_sep = strchr(at, G_SEARCHPATH_SEPARATOR); + if (next_sep == at) { /* * Empty path: try next character (supported * to conform to the typical parsing of $PATH). */ at++; continue; - } else if (!next_colon) { - /* No more colon: use the remaining */ - next_colon = paths + strlen(paths); + } else if (!next_sep) { + /* No more separator: use the remaining */ + next_sep = paths + strlen(paths); } path = g_string_new(NULL); @@ -221,8 +221,8 @@ int bt_common_append_plugin_path_dirs(const char *paths, GPtrArray *dirs) goto error; } - g_string_append_len(path, at, next_colon - at); - at = next_colon + 1; + g_string_append_len(path, at, next_sep - at); + at = next_sep + 1; g_ptr_array_add(dirs, path); }