aboutsummaryrefslogtreecommitdiffstats
path: root/gtk/file_dlg_win32.c
diff options
context:
space:
mode:
authorBill Meier <wmeier@newsguy.com>2009-03-08 22:19:49 +0000
committerBill Meier <wmeier@newsguy.com>2009-03-08 22:19:49 +0000
commitb663f6d2180e7635b4e8372779452f8aeb3bff48 (patch)
treea460126035c95596b783bfffeaffd73648dec781 /gtk/file_dlg_win32.c
parent8837679be034998349714a372513d3f4ded2d8f8 (diff)
Fix File ! Save As on Windows to properly delete an existing file even if the
path\filename contains non-ascii characters. svn path=/trunk/; revision=27662
Diffstat (limited to 'gtk/file_dlg_win32.c')
-rw-r--r--gtk/file_dlg_win32.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/gtk/file_dlg_win32.c b/gtk/file_dlg_win32.c
index c66b6feb4b..906e783c84 100644
--- a/gtk/file_dlg_win32.c
+++ b/gtk/file_dlg_win32.c
@@ -45,7 +45,8 @@
#include "epan/filesystem.h"
#include "epan/addr_resolv.h"
#include "epan/prefs.h"
-#include <wsutil/unicode-utils.h>
+#include "wsutil/file_util.h"
+#include "wsutil/unicode-utils.h"
#include "../globals.h"
#include "../alert_box.h"
@@ -294,9 +295,11 @@ win32_save_as_file(HWND h_wnd, action_after_save_e action_after_save, gpointer a
/* Write out the packets (all, or only the ones from the current
range) to the file with the specified name. */
- /* GetSaveFileName() already asked the user if he wants to overwrite the old file, */
- /* so if we are here, user already confirmed to overwrite - just delete the old file now */
- unlink(file_name8->str);
+ /* GetSaveFileName() already asked the user if he wants to overwrite the old file, */
+ /* so if we are here, user already confirmed to overwrite - just delete the old file now. */
+ ws_unlink(file_name8->str); /* XX: Windows Wireshark is built with GLIB >= 2.6 these */
+ /* days so ws_unlink will properly convert the */
+ /* UTF8 filename to UTF16 & then do a _wunlink. */
if (cf_save(&cfile, file_name8->str, &range, filetype, FALSE) != CF_OK) {
/* The write failed. Try again. */