diff --git a/src/modules/file/file.cpp b/src/modules/file/file.cpp index d8bac8c..acc1fa2 100644 --- a/src/modules/file/file.cpp +++ b/src/modules/file/file.cpp @@ -22,17 +22,12 @@ Value modules::file(std::vector args) { } std::string buf; std::string retval; - bool notfirst = false; while (getline(file, buf)) { - if (notfirst) { - buf += "\n"; - } else { - notfirst = true; - } + buf += "\n"; retval += buf; } file.close(); - return Value(retval); + return Value("\"" + retval + "\""); } else if (args[0].string_val == "readlines") { std::ifstream file(args[1].string_val); if (!file) { @@ -42,7 +37,7 @@ Value modules::file(std::vector args) { std::string buf; std::vector retval; while (getline(file, buf)) { - retval.push_back(Value(buf)); + retval.push_back(Value("\"" + buf + "\"")); } file.close(); return Value(retval);