Fix: Extra newline added for no reason.
This commit is contained in:
parent
11aee2ab21
commit
9c25a04ebe
|
@ -217,8 +217,14 @@ std::string spmenu::Run(spmenu::spmenuSettings *settings) {
|
|||
}
|
||||
|
||||
while (fgets(buf.data(), buf.size(), pipe.get()) != NULL) {
|
||||
size_t len = strlen(buf.data());
|
||||
|
||||
if (len > 0 && buf[len - 1] == '\n') {
|
||||
ret += std::string(buf.data(), len - 1);
|
||||
} else {
|
||||
ret += buf.data();
|
||||
}
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue