From 30c0382d2067c3bfb1895ed0d8f52859d5df62cb Mon Sep 17 00:00:00 2001 From: Won-Kyu Park Date: Mon, 27 Feb 2023 02:39:18 +0900 Subject: win32: fix for win32. --- hangul/hangulkeyboard.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/hangul/hangulkeyboard.c b/hangul/hangulkeyboard.c index bf87923..97be149 100644 --- a/hangul/hangulkeyboard.c +++ b/hangul/hangulkeyboard.c @@ -29,7 +29,6 @@ #ifdef HAVE_GLOB_H #include #endif /* HAVE_GLOB_H */ -#include #include #endif /* ENABLE_EXTERNAL_KEYBOARDS */ @@ -679,8 +678,11 @@ on_element_start(void* data, const XML_Char* element, const XML_Char** attr) strncpy(path, file, n); } else { char* orig_path = strdup(context->path_stack[top]); - char* dir = dirname(orig_path); - snprintf(path, n, "%s/%s", dir, file); + char* last_slash = strrchr(orig_path, '/'); + if (last_slash) + last_slash[0] = '\0'; + + snprintf(path, n, "%s/%s", orig_path, file); free(orig_path); } -- cgit v1.2.1