Windows: accept backslashes in file names
Without this patch, a warning gets printed for any .yang files that are
read using native path names:
libyang[1]: File name "D:\a\oopt-gnpy-libyang\oopt-gnpy-libyang\tests\yang\ietf-network@2018-02-26.yang" does not match module name "ietf-network".
diff --git a/src/tree_schema_common.c b/src/tree_schema_common.c
index b676cba..27b3ceb 100644
--- a/src/tree_schema_common.c
+++ b/src/tree_schema_common.c
@@ -2599,6 +2599,13 @@
/* check that name and revision match filename */
basename = strrchr(filename, '/');
+#ifdef _WIN32
+ const char *backslash = strrchr(filename, '\\');
+
+ if (!basename || (basename && backslash && (backslash > basename))) {
+ basename = backslash;
+ }
+#endif
if (!basename) {
basename = filename;
} else {