]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
fix backspace path under windows - handles any order
authorJeff Lenk <jeff@jefflenk.com>
Wed, 6 Jan 2010 15:57:36 +0000 (15:57 +0000)
committerJeff Lenk <jeff@jefflenk.com>
Wed, 6 Jan 2010 15:57:36 +0000 (15:57 +0000)
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@16182 d0543943-73ff-0310-b7d9-9358b9ac24b2

src/switch_xml.c

index e2b303564839280c73857e9105fb5f00852d8daf..dce72ba71c1639f8ebe42669adb03af04692e120 100644 (file)
@@ -1484,10 +1484,11 @@ SWITCH_DECLARE(switch_xml_t) switch_xml_parse_file(const char *file)
        int fd = -1, write_fd = -1;
        switch_xml_t xml = NULL;
        char *new_file = NULL;
-       const char *abs;
+       const char *abs, *absw;
 
-       if ((abs = strrchr(file, '/')) || (abs = strrchr(file, '\\'))) {
-               abs++;
+       abs = strrchr(file, '/'); absw = strrchr(file, '\\');
+       if (abs || absw) {
+               abs > absw ? abs++ : (abs = ++absw);
        } else {
                abs = file;
        }