Convert forward slashes in URI to backslashes if WIN32. Patch from Cal Turney via https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=5237

svn path=/trunk/; revision=40615
This commit is contained in:
Chris Maynard 2012-01-20 21:20:53 +00:00
parent d528b4b0f1
commit 80087898ea
1 changed files with 10 additions and 4 deletions

View File

@ -141,6 +141,12 @@ dnd_uri2filename(gchar *cf_name)
src++;
}
}
#ifdef _WIN32
} else if (*src == '/') {
*dest = '\\';
src++;
dest++;
#endif
} else {
*dest = *src;
src++;
@ -382,12 +388,12 @@ gtk_osx_openFile (GtkOSXApplication *app _U_, gchar *path, gpointer user_data _U
selection_path[length] = '\r';
selection_path[length + 1] = '\n';
selection_path[length + 2] = '\0';
gtk_selection_data_set_text(&selection_data, selection_path, length);
dnd_data_received(NULL, NULL, 0, 0, &selection_data, DND_TARGET_URL, 0, 0);
g_free(selection_path);
return TRUE;
}
#endif
@ -411,7 +417,7 @@ dnd_init(GtkWidget *w)
/* get notified, if some dnd coming in */
g_signal_connect(w, "drag_data_received", G_CALLBACK(dnd_data_received), NULL);
#ifdef HAVE_GTKOSXAPPLICATION
#ifdef HAVE_GTKOSXAPPLICATION
g_signal_connect(g_object_new(GTK_TYPE_OSX_APPLICATION, NULL), "NSApplicationOpenFile", G_CALLBACK(gtk_osx_openFile), NULL);
#endif
}