From 4d3ae39d5013e24f78fb2c4b073d71bc318c594b Mon Sep 17 00:00:00 2001 From: player-03 Date: Sat, 1 Apr 2023 11:56:41 -0400 Subject: [PATCH] Use forward slashes to load lime.ndll. `substr(7)` returns the substring _starting_ at character 7, which will never be "windows". The author meant to type `substr(0, 7)` instead, to get the substring ending at 7. We could easily make this change, but given that the code has been successfully using forward slashes for several years, I prefer to simplify. --- src/lime/system/CFFI.hx | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/lime/system/CFFI.hx b/src/lime/system/CFFI.hx index 4f36f0306..3aa9eba9f 100644 --- a/src/lime/system/CFFI.hx +++ b/src/lime/system/CFFI.hx @@ -149,16 +149,15 @@ class CFFI if (result == null) { - var slash = (__sysName().substr(7).toLowerCase() == "windows") ? "\\" : "/"; var haxelib = __findHaxelib("lime"); if (haxelib != "") { - result = __tryLoad(haxelib + slash + "ndll" + slash + __sysName() + slash + library, library, method, args); + result = __tryLoad(haxelib + "/ndll/" + __sysName() + "/" + library, library, method, args); if (result == null) { - result = __tryLoad(haxelib + slash + "ndll" + slash + __sysName() + "64" + slash + library, library, method, args); + result = __tryLoad(haxelib + "/ndll/" + __sysName() + "64/" + library, library, method, args); } } }