Merge pull request #186 from seisatsu/master

Fix save filename newline bug on Linux
This commit is contained in:
2018-03-23 20:42:08 -04:00
committed by GitHub

View File

@@ -159,6 +159,11 @@ static std::string runFileDialog(const std::string& file, bool save) {
if (fgets(buffer, 128, hfile) != NULL) if (fgets(buffer, 128, hfile) != NULL)
filename += buffer; 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); pclose(hfile);
return filename; return filename;
} }