file_last_dot = strrchr(file_name8->str,'.');
if(file_last_dot == NULL || strlen(file_name8->str)-(file_last_dot-file_name8->str) > 5+1) {
if(wtap_file_extension_default_string(filetype) != NULL) {
- file_name8 = g_string_append(file_name8, wtap_file_extension_default_string(filetype));
+ file_name8 = g_string_append_printf(file_name8, ".%s", wtap_file_extension_default_string(filetype));
}
}
g_slist_free(extensions);
}
-/* Return the default file extension to use with the specified file type. */
+/* Return the default file extension to use with the specified file type;
+ that's just the extension, without any ".". */
const char *wtap_file_extension_default_string(int filetype)
{
if (filetype < 0 || filetype >= wtap_num_file_types)
return NULL;
- else
- return dump_open_table[filetype].file_extension_default;
+ else {
+ /*
+ * XXX - skip past the ".".
+ */
+ return dump_open_table[filetype].file_extension_default + 1;
+ }
}
gboolean wtap_dump_can_open(int filetype)