aboutsummaryrefslogtreecommitdiffstats
path: root/wiretap/file_access.c
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2012-05-23 03:05:17 +0000
committerGuy Harris <guy@alum.mit.edu>2012-05-23 03:05:17 +0000
commite6a57c8e93e7356b10f218d2d322e57b3d1e2116 (patch)
tree5e573ff4328c4e802fb0ea814744217178b4f9ad /wiretap/file_access.c
parent26974768ddad0ab4fb3eb85510b52e15ee232080 (diff)
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
Diffstat (limited to 'wiretap/file_access.c')
-rw-r--r--wiretap/file_access.c16
1 files changed, 11 insertions, 5 deletions
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