From 6b259d7000c61111fd25102e37db2ebe83a03327 Mon Sep 17 00:00:00 2001 From: Michel Ludwig Date: Fri, 19 Jan 2018 21:23:02 +0100 Subject: [PATCH] Use Windows ANSI versions of the PathFind... methods Differential Revision: https://phabricator.kde.org/D9937 --- .../16-use-windows-ansi-api-path-find.diff | 19 +++++++++++++++++++ core/synctex/patches/series | 1 + core/synctex/synctex_parser_utils.c | 4 ++-- 3 files changed, 22 insertions(+), 2 deletions(-) create mode 100644 core/synctex/patches/16-use-windows-ansi-api-path-find.diff diff --git a/core/synctex/patches/16-use-windows-ansi-api-path-find.diff b/core/synctex/patches/16-use-windows-ansi-api-path-find.diff new file mode 100644 index 000000000..de2e3c4ff --- /dev/null +++ b/core/synctex/patches/16-use-windows-ansi-api-path-find.diff @@ -0,0 +1,19 @@ +Use Windows ANSI versions of the PathFind... methods + +Author: Michel Ludwig + + +Index: synctex/synctex_parser_utils.c +--- synctex.orig/synctex_parser_utils.c ++++ synctex/synctex_parser_utils.c +@@ -187,8 +187,8 @@ void _synctex_strip_last_path_extension(char * string) { + char * last_component = NULL; + char * last_extension = NULL; + # if defined(SYNCTEX_WINDOWS) +- last_component = PathFindFileName(string); +- last_extension = PathFindExtension(string); ++ last_component = PathFindFileNameA(string); ++ last_extension = PathFindExtensionA(string); + if(last_extension == NULL)return; + if(last_component == NULL)last_component = string; + if(last_extension>last_component){/* filter out paths like "my/dir/.hidden" */ diff --git a/core/synctex/patches/series b/core/synctex/patches/series index d9482f9ce..4be2c204a 100644 --- a/core/synctex/patches/series +++ b/core/synctex/patches/series @@ -8,3 +8,4 @@ 13-fix-Wundef-warnings.diff 14-fix-misc-compiler-warnings.diff 15-prevent-leaks-and-segfault.diff +16-use-windows-ansi-api-path-find.diff diff --git a/core/synctex/synctex_parser_utils.c b/core/synctex/synctex_parser_utils.c index fdbf5813b..3c0d63b71 100644 --- a/core/synctex/synctex_parser_utils.c +++ b/core/synctex/synctex_parser_utils.c @@ -187,8 +187,8 @@ void _synctex_strip_last_path_extension(char * string) { char * last_component = NULL; char * last_extension = NULL; # if defined(SYNCTEX_WINDOWS) - last_component = PathFindFileName(string); - last_extension = PathFindExtension(string); + last_component = PathFindFileNameA(string); + last_extension = PathFindExtensionA(string); if(last_extension == NULL)return; if(last_component == NULL)last_component = string; if(last_extension>last_component){/* filter out paths like "my/dir/.hidden" */