summaryrefslogtreecommitdiff
path: root/ui/qt/main_window.cpp
diff options
context:
space:
mode:
authorРоман Донченко <dpb@corrigendum.ru>2016-12-07 01:14:39 +0300
committerGerald Combs <gerald@wireshark.org>2016-12-07 20:36:43 +0000
commit49fcee3fcb997036f8677af081a5cbecab7c07e0 (patch)
treeb087d43a86579faa9d1da219caa0e08c104dd264 /ui/qt/main_window.cpp
parent983334fc1e6f95c88b9e35176feedf66d9dd484d (diff)
downloadwireshark-49fcee3fcb997036f8677af081a5cbecab7c07e0.tar.gz
Qt: don't append a second extension to save file names
When checking if the file already has one of the possible extensions, MainWindow::fileAddExtension reuses file_suffix between iterations and appends to it each time, so it ends up checking for the wrong suffix for all extensions except the first one. Scope file_suffix to the for loop to fix that. Change-Id: Idbc5a619a4793d8c477bfd88305cdb44ea844e13 Reviewed-on: https://code.wireshark.org/review/19123 Petri-Dish: Gerald Combs <gerald@wireshark.org> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Gerald Combs <gerald@wireshark.org>
Diffstat (limited to 'ui/qt/main_window.cpp')
-rw-r--r--ui/qt/main_window.cpp3
1 files changed, 1 insertions, 2 deletions
diff --git a/ui/qt/main_window.cpp b/ui/qt/main_window.cpp
index 506907917d..d193dde993 100644
--- a/ui/qt/main_window.cpp
+++ b/ui/qt/main_window.cpp
@@ -1495,7 +1495,6 @@ void MainWindow::exportDissections(export_type_e export_type) {
void MainWindow::fileAddExtension(QString &file_name, int file_type, bool compressed) {
QString file_name_lower;
- QString file_suffix;
GSList *extensions_list;
gboolean add_extension;
@@ -1516,7 +1515,7 @@ void MainWindow::fileAddExtension(QString &file_name, int file_type, bool compre
/* OK, see if the file has one of those extensions. */
for (extension = extensions_list; extension != NULL;
extension = g_slist_next(extension)) {
- file_suffix += tr(".") + (char *)extension->data;
+ QString file_suffix = tr(".") + (char *)extension->data;
if (file_name_lower.endsWith(file_suffix)) {
/*
* The file name has one of the extensions for