diff --git a/.gitignore b/.gitignore index 2a23619ef..d51b5bcd3 100644 --- a/.gitignore +++ b/.gitignore @@ -82,7 +82,7 @@ DerivedData/ # Jetbrains project .idea/ -cmake-build-debug/ +cmake-build-*/ # CMake stuff CMakeCache.txt diff --git a/BINDINGS.md b/BINDINGS.md index 9f43546ec..2d1975c47 100644 --- a/BINDINGS.md +++ b/BINDINGS.md @@ -6,7 +6,7 @@ Here it is a list with the ones I'm aware of: | name | raylib version | language | repo | |:------------------:|:-------------: | :--------:|----------------------------------------------------------------------| -| raylib | **3.1-dev** | [C](https://en.wikipedia.org/wiki/C_(programming_language)) | https://github.com/raysan5/raylib | +| raylib | **3.5** | [C](https://en.wikipedia.org/wiki/C_(programming_language)) | https://github.com/raysan5/raylib | | raylib-cpp | 3.5 | [C++](https://en.wikipedia.org/wiki/C%2B%2B) | https://github.com/robloach/raylib-cpp | | Raylib-cs | 3.5 | [C#](https://en.wikipedia.org/wiki/C_Sharp_(programming_language)) | https://github.com/ChrisDill/Raylib-cs | | raylib-cppsharp | 2.5 | [C#](https://en.wikipedia.org/wiki/C_Sharp_(programming_language)) | https://github.com/phxvyper/raylib-cppsharp | @@ -46,12 +46,12 @@ Here it is a list with the ones I'm aware of: | raylib-ruby | 2.6 | [Ruby](https://www.ruby-lang.org/en/) | https://github.com/a0/raylib-ruby | | raylib-mruby | 2.5-dev | [mruby](https://github.com/mruby/mruby) | https://github.com/lihaochen910/raylib-mruby | | raylib-py | 2.0 | [Python](https://www.python.org/) | https://github.com/overdev/raylib-py | -| raylib-python-cffi | 3.1-dev | [Python](https://www.python.org/) | https://github.com/electronstudio/raylib-python-cffi | +| raylib-python-cffi | 3.5 | [Python](https://www.python.org/) | https://github.com/electronstudio/raylib-python-cffi | | raylib-py-ctbg | 2.6 | [Python](https://www.python.org/) | https://github.com/overdev/raylib-py-ctbg | | jaylib | 3.0 | [Java](https://en.wikipedia.org/wiki/Java_(programming_language)) | https://github.com/electronstudio/jaylib/ | | raylib-java | 2.0 | [Java](https://en.wikipedia.org/wiki/Java_(programming_language)) | https://github.com/XoanaIO/raylib-java | | clj-raylib | 3.0 | [Clojure](https://clojure.org/) | https://github.com/lsevero/clj-raylib | -| node-raylib | 3.0 | [Node.js](https://nodejs.org/en/) | https://github.com/RobLoach/node-raylib | +| node-raylib | 3.5 | [Node.js](https://nodejs.org/en/) | https://github.com/RobLoach/node-raylib | | QuickJS-raylib | 3.0 | [QuickJS](https://bellard.org/quickjs/) | https://github.com/sntg-p/QuickJS-raylib | | raylib-js | 2.6 | [JavaScript](https://en.wikipedia.org/wiki/JavaScript) | https://github.com/RobLoach/raylib-js | | raylib-chaiscript | 2.6 | [ChaiScript](http://chaiscript.com/) | https://github.com/RobLoach/raylib-chaiscript | diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index b94ac1498..3319ef03d 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -105,7 +105,6 @@ target_include_directories(raylib $ PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} - ${CMAKE_CURRENT_SOURCE_DIR}/external ${CMAKE_BINARY_DIR} # For cmake/config.h ${OPENGL_INCLUDE_DIR} ${OPENAL_INCLUDE_DIR} diff --git a/src/core.c b/src/core.c index d7bff21fe..4162e8936 100644 --- a/src/core.c +++ b/src/core.c @@ -2353,7 +2353,7 @@ const char *GetFileName(const char *filePath) const char *fileName = NULL; if (filePath != NULL) fileName = strprbrk(filePath, "\\/"); - if (!fileName || (fileName == filePath)) return filePath; + if (!fileName) return filePath; return fileName + 1; } @@ -2399,9 +2399,9 @@ const char *GetDirectoryPath(const char *filePath) static char dirPath[MAX_FILEPATH_LENGTH]; memset(dirPath, 0, MAX_FILEPATH_LENGTH); - // In case provided path does not contains a root drive letter (C:\, D:\), + // In case provided path does not contain a root drive letter (C:\, D:\) nor leading path separator (\, /), // we add the current directory path to dirPath - if (filePath[1] != ':') + if (filePath[1] != ':' && filePath[0] != '\\' && filePath[0] != '/') { // For security, we set starting path to current directory, // obtained path will be concated to this @@ -2412,9 +2412,18 @@ const char *GetDirectoryPath(const char *filePath) lastSlash = strprbrk(filePath, "\\/"); if (lastSlash) { - // NOTE: Be careful, strncpy() is not safe, it does not care about '\0' - memcpy(dirPath + ((filePath[1] != ':')? 2 : 0), filePath, strlen(filePath) - (strlen(lastSlash) - 1)); - dirPath[strlen(filePath) - strlen(lastSlash) + ((filePath[1] != ':')? 2 : 0)] = '\0'; // Add '\0' manually + if (lastSlash == filePath) + { + // The last and only slash is the leading one: path is in a root directory + dirPath[0] = filePath[0]; + dirPath[1] = '\0'; + } + else + { + // NOTE: Be careful, strncpy() is not safe, it does not care about '\0' + memcpy(dirPath + (filePath[1] != ':' && filePath[0] != '\\' && filePath[0] != '/' ? 2 : 0), filePath, strlen(filePath) - (strlen(lastSlash) - 1)); + dirPath[strlen(filePath) - strlen(lastSlash) + (filePath[1] != ':' && filePath[0] != '\\' && filePath[0] != '/' ? 2 : 0)] = '\0'; // Add '\0' manually + } } return dirPath;