- posix = g_regex_new("^posix/$", 0, 0, &err);
- right = g_regex_new("^right/$", 0, 0, &err);
+ posix = g_regex_new(posix_prefix_pattern, 0, 0, &err);
+ right = g_regex_new(right_prefix_pattern, 0, 0, &err);
+
+ if(g_regex_match_full(posix, pair[0], -1, 0, G_REGEX_MATCH_NOTEMPTY, NULL, NULL)) {
+
+ ret.posix = TRUE;
+ lean_path = g_regex_replace_literal(posix, pair[0], -1, 0, "", G_REGEX_MATCH_NOTEMPTY, NULL);
+
+ } else if(g_regex_match_full(right, pair[0], -1, 0, G_REGEX_MATCH_NOTEMPTY, NULL, NULL)) {
+
+ ret.right = TRUE;
+ lean_path = g_regex_replace_literal(right, pair[0], -1, 0, "", G_REGEX_MATCH_NOTEMPTY, NULL);
+
+ } else
+ lean_path = g_regex_replace_literal(prefix, pair[0], -1, 0, "", G_REGEX_MATCH_NOTEMPTY, NULL);
+
+ ret.path = lean_path;
+
+ ret.sum = g_malloc0(256);
+ g_strlcpy(ret.sum, pair[1], 66);