diff --git a/src/tools/winutil.linux.cpp b/src/tools/winutil.linux.cpp index 7170c72e2..fc381e8c4 100644 --- a/src/tools/winutil.linux.cpp +++ b/src/tools/winutil.linux.cpp @@ -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; }