]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
fix FSCORE-55
authorAnthony Minessale <anthony.minessale@gmail.com>
Tue, 23 Oct 2007 19:32:36 +0000 (19:32 +0000)
committerAnthony Minessale <anthony.minessale@gmail.com>
Tue, 23 Oct 2007 19:32:36 +0000 (19:32 +0000)
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@6036 d0543943-73ff-0310-b7d9-9358b9ac24b2

src/switch_xml.c

index 4efc62eb7d23ab688d4adc0c92c28333c056d0e1..651fba5408ba9f41dce8f4546f5a2ecf6df58ed6 100644 (file)
@@ -956,9 +956,12 @@ static int preprocess_glob(const char *pattern, int write_fd, int rlevel)
                        *p = '\0';
                }
        } else {
-               dir_path = SWITCH_GLOBAL_dirs.conf_dir;
                p = switch_core_sprintf(pool, "%s%s%s", SWITCH_GLOBAL_dirs.conf_dir, SWITCH_PATH_SEPARATOR, pattern);
                pattern = p;
+               dir_path = switch_core_strdup(pool, pattern);
+               if ((p = strrchr(dir_path, *SWITCH_PATH_SEPARATOR))) {
+                       *p = '\0';
+               }
        }
 
        switch_match_glob(pattern, &result, pool);
@@ -967,7 +970,6 @@ static int preprocess_glob(const char *pattern, int write_fd, int rlevel)
 
     for (i = 0; i < result->nelts; i++) {
                char *path = list[i];
-
                if (strcmp(path, ".") && strcmp(path, "..")) {
                        p = switch_core_sprintf(pool, "%s%s%s", dir_path, SWITCH_PATH_SEPARATOR, path);
                        if (preprocess(p, write_fd, rlevel) < 0) {