diff options
author | Cleverking2003 <30466983+Cleverking2003@users.noreply.github.com> | 2020-06-30 21:12:50 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-06-30 21:12:50 +0300 |
commit | dd3fb084c96e5afdefce7541a05289c6cc96f5dc (patch) | |
tree | 0815aaf7c7d7c549ab6f7e9e573de9550489d83e | |
parent | c64d5facaa8e82e676c9187e93328e9e2a4e8c71 (diff) | |
parent | 34869c7fec2c83ea4d06d33a11e314f215d70c6e (diff) |
Merge pull request #204 from PikalaxALT/pikalax_work
Fix CRLF handling in .knarckeep/.knarcignore
-rw-r--r-- | .travis/calcrom/calcrom.cpp | 4 | ||||
-rw-r--r-- | CMakeLists.txt | 4 | ||||
-rw-r--r-- | tools/knarc/Narc.cpp | 11 |
3 files changed, 17 insertions, 2 deletions
diff --git a/.travis/calcrom/calcrom.cpp b/.travis/calcrom/calcrom.cpp index a78c185f..2947f5e7 100644 --- a/.travis/calcrom/calcrom.cpp +++ b/.travis/calcrom/calcrom.cpp @@ -15,8 +15,10 @@ * Initial implementation * - 0.1.1 (26 May 2020): * Allow program to be run from wherever - * 0.1.2 (27 May 2020): + * - 0.1.2 (27 May 2020): * Extra security on ELF header + * - 0.1.3 (30 Jun 2020): + * Account for diamond/pearl split */ #include <iostream> diff --git a/CMakeLists.txt b/CMakeLists.txt index f1d54918..398b650f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -6,6 +6,10 @@ set(CMAKE_CXX_STANDARD 17) enable_language(ASM) +if(APPLE) + include_directories(/usr/local/include) +endif(APPLE) + add_compile_options(-fms-extensions) file(GLOB_RECURSE SOURCES RELATIVE ${CMAKE_SOURCE_DIR} "*.c" "*.cpp") diff --git a/tools/knarc/Narc.cpp b/tools/knarc/Narc.cpp index 7ccdcf0e..2faed98e 100644 --- a/tools/knarc/Narc.cpp +++ b/tools/knarc/Narc.cpp @@ -117,7 +117,16 @@ public: infile.open(fp, ios_base::in); string line; while (getline(infile, line)) { - push_back(line); + if (!line.empty()) + { + // strip CR + size_t i; + for (i = line.size() - 1; line[i] == '\r'; i--) + ; + if (i < line.size() - 1) + line.erase(i + 1); + push_back(line); + } } } bool matches(string fp) { |