- while (s.good ()) {
- string line = s.getline ();
- trim (line);
- if (line.length() > 55) {
- string const file = line.substr (55);
- if (file != "." && file != "..") {
- ls.push_back (file);
+ string line;
+ for (size_t i = 0; i < ls_raw.length(); ++i) {
+ line += ls_raw[i];
+ if (ls_raw[i] == '\n') {
+ trim (line);
+ if (line.length() > 55) {
+ string const file = line.substr (55);
+ if (file != "." && file != "..") {
+ ls.push_back (file);
+ }