From 87ae074b51ba30501c60ff88782dc2ccd5ef0daa Mon Sep 17 00:00:00 2001 From: LRN Date: Sun, 22 Jul 2012 13:47:00 +0000 Subject: DOS-pathsep-compatible filename extraction --- src/transport/transport-testing.c | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) (limited to 'src/transport/transport-testing.c') diff --git a/src/transport/transport-testing.c b/src/transport/transport-testing.c index 87ce70423..8919aa555 100644 --- a/src/transport/transport-testing.c +++ b/src/transport/transport-testing.c @@ -611,7 +611,25 @@ extract_filename (const char *file) char *backup = pch; char *filename = NULL; char *res; - +#if WINDOWS + if ((strlen (pch) >= 3) && pch[1] == ':') + { + if (NULL != strstr (pch, "\\")) + { + pch = strtok (pch, "\\"); + while (pch != NULL) + { + pch = strtok (NULL, "\\"); + if (pch != NULL) + filename = pch; + } + } + } + if (filename != NULL) + pch = filename; /* If we miss the next condition, filename = pch will + * not harm us. + */ +#endif if (NULL != strstr (pch, "/")) { pch = strtok (pch, "/"); -- cgit v1.2.3