From 57f349be10175996f7633726bbdc0b098a1df56f Mon Sep 17 00:00:00 2001 From: Martin Winkler Date: Mon, 6 Mar 2017 14:46:20 +0000 Subject: [PATCH] - fix gnu_basename() to also detect windows path ("\\") --- src/ext/xstring.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/ext/xstring.c b/src/ext/xstring.c index d365efe..db96d1b 100644 --- a/src/ext/xstring.c +++ b/src/ext/xstring.c @@ -15,7 +15,12 @@ char* gnu_basename(char *path) { + char *baseWin = strrchr(path, '\\'); char *base = strrchr(path, '/'); + if (baseWin > base) + { + base = baseWin; + } return base ? base + 1 : path; }