diff options
author | Tiger Wang <ziwei.tiger@hotmail.co.uk> | 2016-11-07 23:15:07 +0100 |
---|---|---|
committer | Alexander Harkness <me@bearbin.net> | 2016-12-12 15:32:32 +0100 |
commit | 8c6d0b51c719e1817e308375d129b17ede3b82fc (patch) | |
tree | 8aa23d1db5e4198f6aeed5091ad6adedc12fea35 /src/FurnaceRecipe.cpp | |
parent | Merge pull request #3476 from Seadragon91/patch-1 (diff) | |
download | cuberite-8c6d0b51c719e1817e308375d129b17ede3b82fc.tar cuberite-8c6d0b51c719e1817e308375d129b17ede3b82fc.tar.gz cuberite-8c6d0b51c719e1817e308375d129b17ede3b82fc.tar.bz2 cuberite-8c6d0b51c719e1817e308375d129b17ede3b82fc.tar.lz cuberite-8c6d0b51c719e1817e308375d129b17ede3b82fc.tar.xz cuberite-8c6d0b51c719e1817e308375d129b17ede3b82fc.tar.zst cuberite-8c6d0b51c719e1817e308375d129b17ede3b82fc.zip |
Diffstat (limited to '')
-rw-r--r-- | src/FurnaceRecipe.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/FurnaceRecipe.cpp b/src/FurnaceRecipe.cpp index 2c20eec0f..d1082b63f 100644 --- a/src/FurnaceRecipe.cpp +++ b/src/FurnaceRecipe.cpp @@ -6,7 +6,7 @@ #include <fstream> -#define FURNACE_RECIPE_FILE "furnace.txt" +#define FURNACE_RECIPE_FILE FILE_IO_PREFIX "furnace.txt" @@ -70,6 +70,10 @@ void cFurnaceRecipe::ReloadRecipes(void) LineNum++; if (ParsingLine.empty()) { + // There is a problem here on Android. Text files transferred from another OS may have a newline representation Android's implementation of getline doesn't expect + // Thus, part of a newline may be left in ParsingLine. ::empty() thus thinks the string isn't empty, and the below code outputs interesting errors since it was passed a nearly empty string + // Ref: http://stackoverflow.com/questions/6089231/getting-std-ifstream-to-handle-lf-cr-and-crlf + // TODO: There is a solution in the above reference, but it isn't very pretty. Fix it somehow. continue; } |