Port: plugin system compat for mingw / macOS
[babeltrace.git] / common / common.c
index 0a0d15836e329d866c40286ded145f209d671b2e..363ffe2da5725e031954edc75f8c0d3928640ae2 100644 (file)
@@ -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);
        }
 
This page took 0.024785 seconds and 4 git commands to generate.