Linux handle zenity non-zero code. Close #301
This commit is contained in:
@@ -146,11 +146,16 @@ static std::string runFileDialog(const std::string& file, bool save) {
|
||||
filename += buffer;
|
||||
}
|
||||
|
||||
// When the dialogue is canceled, return empty string.
|
||||
int result = pclose(hfile);
|
||||
if (result != 0) {
|
||||
return "";
|
||||
}
|
||||
|
||||
// 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;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user