Browse Source

Bug fix

release/0.19
JustinAJ 10 years ago
parent
commit
70a98b1b9c
  1. 21
      Jupiter/File.cpp

21
Jupiter/File.cpp

@ -132,22 +132,22 @@ bool Jupiter::File::load(const Jupiter::ReadableString &file)
bool Jupiter::File::load(FILE *file)
{
Jupiter::String buffer(defaultBufferSize);
int c;
int c = fgetc(file);
for (;;)
{
c = fgetc(file);
if (c == EOF)
return false;
if (containsSymbol(ENDL, static_cast<char>(c)))
{
Jupiter::File::data_->lines.add(new Jupiter::StringS(buffer));
buffer.truncate(buffer.size());
break;
c = fgetc(file);
if (c == EOF)
return true;
if (containsSymbol(ENDL, static_cast<char>(c)) == false)
buffer.concat(static_cast<char>(c));
}
else
buffer.concat(static_cast<char>(c));
}
for (;;)
{
c = fgetc(file);
@ -157,12 +157,17 @@ bool Jupiter::File::load(FILE *file)
{
Jupiter::File::data_->lines.add(new Jupiter::StringS(buffer));
buffer.truncate(buffer.size());
c = fgetc(file);
if (c == EOF)
return true;
if (containsSymbol(ENDL, static_cast<char>(c)) == false)
buffer.concat(static_cast<char>(c));
}
else
buffer.concat(static_cast<char>(c));
}
return false;
return true;
}
void Jupiter::File::unload()

Loading…
Cancel
Save