From d98bc5cf2f8279cecd716ca93337d40bf1828f3e Mon Sep 17 00:00:00 2001 From: rfm Date: Tue, 21 Nov 2023 13:18:43 +0000 Subject: [PATCH] Fix path format for backslashes on windows --- ChangeLog | 5 +++++ Source/objc-load.m | 14 ++++++++++++-- 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index b8e2d6e778..a3fb6d027e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2023-11-21 Richard Frith-Macdonald + + * Source/objc-load.m: Fix to get library path in standardised form to + match code for getting executable path. + 2023-11-21 Richard Frith-Macdonald * Headers/GNUstepBase/GSVersionMacros.h: Added GS_UNIMPLEMENTED to diff --git a/Source/objc-load.m b/Source/objc-load.m index c57b966276..3cfeb33dea 100644 --- a/Source/objc-load.m +++ b/Source/objc-load.m @@ -259,6 +259,8 @@ #warning Under Cygwin, we may want to use cygwin_conv_path() to get the unix path back? #endif s = [NSString stringWithCharacters: buf length: wcslen(buf)]; + s = [s stringByResolvingSymlinksInPath]; + s = [s stringByStandardizingPath]; } return s; } @@ -275,7 +277,11 @@ */ if (0 != dladdr((void*)theClass, &info)) { - return [NSString stringWithUTF8String: info.dli_fname]; + NSString *s; + + s = [NSString stringWithUTF8String: info.dli_fname]; + s = [s stringByResolvingSymlinksInPath]; + s = [s stringByStandardizingPath]; } #endif @@ -317,7 +323,11 @@ if (ret) { - return [NSString stringWithUTF8String: ret]; + NSString *s; + + s = [NSString stringWithUTF8String: ret]; + s = [s stringByResolvingSymlinksInPath]; + s = [s stringByStandardizingPath]; } } return nil;