From 0d739996c65edabab33d1e68fb9152cf67d4bbce Mon Sep 17 00:00:00 2001 From: Xavier Claessens Date: Tue, 8 Aug 2023 15:21:36 -0400 Subject: [PATCH] parser: filename can contain "\" separator on Windows --- girparser.c | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/girparser.c b/girparser.c index 3edeac34e..5ce44262c 100644 --- a/girparser.c +++ b/girparser.c @@ -3728,7 +3728,6 @@ _g_ir_parser_parse_file (GIrParser *parser, gchar *buffer; gsize length; GIrModule *module; - const char *slash; char *dash; char *namespace; @@ -3743,11 +3742,7 @@ _g_ir_parser_parse_file (GIrParser *parser, g_debug ("[parsing] filename %s", filename); - slash = g_strrstr (filename, "/"); - if (!slash) - namespace = g_strdup (filename); - else - namespace = g_strdup (slash+1); + namespace = g_path_get_basename (filename); namespace[strlen(namespace)-4] = '\0'; /* Remove version */