Fix save filename newline bug on Linux

This commit is contained in:
Michael D. Reiley
2018-03-23 17:39:13 -07:00
parent 69589afff7
commit 5a142a656a

View File

@@ -159,6 +159,11 @@ static std::string runFileDialog(const std::string& file, bool save) {
if (fgets(buffer, 128, hfile) != NULL)
filename += buffer;
}
// Remove possible unwanted newline included from end of popen() output
if (filename[filename.length()-1] == '\n')
filename.erase(filename.length()-1);
pclose(hfile);
return filename;
}