Merge branch 'master' into jgrpp-nrt

# Conflicts:
#	config.lib
#	src/core/bitmath_func.hpp
#	src/lang/korean.txt
#	src/main_gui.cpp
#	src/order_gui.cpp
#	src/script/api/script_object.cpp
#	src/station_cmd.cpp
#	src/video/cocoa/wnd_quartz.mm
This commit is contained in:
Jonathan G Rennison
2019-09-18 01:18:28 +01:00
54 changed files with 285 additions and 162 deletions

View File

@@ -317,6 +317,13 @@ int MacOSStringCompare(const char *s1, const char *s2)
CFRelease(cf2);
});
/* If any CFString could not be created (e.g., due to UTF8 invalid chars), return OS unsupported functionality */
if (cf1 == nullptr || cf2 == nullptr) {
if (cf1 != nullptr) CFRelease(cf1);
if (cf2 != nullptr) CFRelease(cf2);
return 0;
}
CFComparisonResult res = CFStringCompareWithOptionsAndLocale(cf1, cf2, CFRangeMake(0, CFStringGetLength(cf1)), flags, _osx_locale);
return (int)res + 2;