From e6a57c8e93e7356b10f218d2d322e57b3d1e2116 Mon Sep 17 00:00:00 2001 From: Guy Harris Date: Wed, 23 May 2012 03:05:17 +0000 Subject: In Windows, in the Save As and Export Selected Packets dialog, append the default extension for the file type iff the file type we're using has a list of extensions; the file has no extension or it has one but it's not one of the ones in the list. *Don't* expect a file extension to be at most 5 characters plus the dot - the extension for pcap-ng, our default capture file type, is "pcapng", and that's 6 characters! svn path=/trunk/; revision=42800 --- wiretap/file_access.c | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) (limited to 'wiretap/file_access.c') diff --git a/wiretap/file_access.c b/wiretap/file_access.c index c823098f52..b6525f07e8 100644 --- a/wiretap/file_access.c +++ b/wiretap/file_access.c @@ -841,12 +841,14 @@ static GSList *add_extensions(GSList *extensions, const gchar *extension, } /* Return a list of file extensions that are used by the specified file type. - This includes compressed extensions, e.g. not just "pcap" but also - "pcap.gz" if we can read gzipped files. + + If include_compressed is TRUE, the list will include compressed + extensions, e.g. not just "pcap" but also "pcap.gz" if we can read + gzipped files. All strings in the list are allocated with g_malloc() and must be freed with g_free(). */ -GSList *wtap_get_file_extensions_list(int filetype) +GSList *wtap_get_file_extensions_list(int filetype, gboolean include_compressed) { gchar **extensions_set, **extensionp; gchar *extension; @@ -862,9 +864,13 @@ GSList *wtap_get_file_extensions_list(int filetype) extensions = NULL; /* empty list, to start with */ /* - * Get the list of compressed-file extensions. + * If include_compressions is true, get the list of compressed-file + * extensions. */ - compressed_file_extensions = wtap_get_compressed_file_extensions(); + if (include_compressed) + compressed_file_extensions = wtap_get_compressed_file_extensions(); + else + compressed_file_extensions = NULL; /* * Add the default extension, and all compressed variants of -- cgit v1.2.3