summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.travis/calcrom/calcrom.cpp4
-rw-r--r--CMakeLists.txt4
-rw-r--r--tools/knarc/Narc.cpp11
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) {