From: Jeff Lenk Date: Wed, 6 Jan 2010 15:57:36 +0000 (+0000) Subject: fix backspace path under windows - handles any order X-Git-Tag: v1.0.6~851 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=da7f9715ec4cf4d02ddcf81f8d6c25049fae87af;p=thirdparty%2Ffreeswitch.git fix backspace path under windows - handles any order git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@16182 d0543943-73ff-0310-b7d9-9358b9ac24b2 --- 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; }