summaryrefslogtreecommitdiffstats
path: root/src/FurnaceRecipe.cpp
diff options
context:
space:
mode:
authorpeterbell10 <peterbell10@live.co.uk>2019-06-11 14:39:44 +0200
committerGitHub <noreply@github.com>2019-06-11 14:39:44 +0200
commit9dc1343bda0592f2d27bb216eb21fdec97f73945 (patch)
tree21124243b854cfbd37cdec70a20e4505deac9f3b /src/FurnaceRecipe.cpp
parentRespect return value of cLuaWindow's OnClicked handler (#4322) (diff)
downloadcuberite-9dc1343bda0592f2d27bb216eb21fdec97f73945.tar
cuberite-9dc1343bda0592f2d27bb216eb21fdec97f73945.tar.gz
cuberite-9dc1343bda0592f2d27bb216eb21fdec97f73945.tar.bz2
cuberite-9dc1343bda0592f2d27bb216eb21fdec97f73945.tar.lz
cuberite-9dc1343bda0592f2d27bb216eb21fdec97f73945.tar.xz
cuberite-9dc1343bda0592f2d27bb216eb21fdec97f73945.tar.zst
cuberite-9dc1343bda0592f2d27bb216eb21fdec97f73945.zip
Diffstat (limited to 'src/FurnaceRecipe.cpp')
-rw-r--r--src/FurnaceRecipe.cpp14
1 files changed, 6 insertions, 8 deletions
diff --git a/src/FurnaceRecipe.cpp b/src/FurnaceRecipe.cpp
index a4647b7a0..3b3141418 100644
--- a/src/FurnaceRecipe.cpp
+++ b/src/FurnaceRecipe.cpp
@@ -68,14 +68,6 @@ void cFurnaceRecipe::ReloadRecipes(void)
while (std::getline(f, ParsingLine))
{
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: https://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;
- }
// Remove comments from the line:
size_t FirstCommentSymbol = ParsingLine.find('#');
@@ -84,6 +76,12 @@ void cFurnaceRecipe::ReloadRecipes(void)
ParsingLine.erase(ParsingLine.begin() + static_cast<const long>(FirstCommentSymbol), ParsingLine.end());
}
+ if (IsOnlyWhitespace(ParsingLine))
+ {
+ // Ignore empty and whitespace only lines
+ continue;
+ }
+
switch (ParsingLine[0])
{
case '#':