From da7f9715ec4cf4d02ddcf81f8d6c25049fae87af Mon Sep 17 00:00:00 2001 From: Jeff Lenk Date: Wed, 6 Jan 2010 15:57:36 +0000 Subject: [PATCH] fix backspace path under windows - handles any order git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@16182 d0543943-73ff-0310-b7d9-9358b9ac24b2 --- src/switch_xml.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/switch_xml.c b/src/switch_xml.c index e2b3035648..dce72ba71c 100644 --- a/src/switch_xml.c +++ b/src/switch_xml.c @@ -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; }