don't crash if the file_set dialog is opened and a "none fileset" file is already...
authorulfl <ulfl@f5534014-38df-0310-8fa8-9805f1628bb7>
Fri, 2 Sep 2005 19:08:25 +0000 (19:08 +0000)
committerulfl <ulfl@f5534014-38df-0310-8fa8-9805f1628bb7>
Fri, 2 Sep 2005 19:08:25 +0000 (19:08 +0000)
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@15671 f5534014-38df-0310-8fa8-9805f1628bb7

gtk/fileset_dlg.c

index ce0cb772617b8900cd0da728e2a9761b1617121b..3507c8377fd38e33d4b77047b015a55971dbc47a 100644 (file)
@@ -133,7 +133,9 @@ fileset_dlg_name2date_dup(const char * name) {
 
 
     /* just to be sure ... */
-    g_assert(fileset_filename_match_pattern(name));
+       if(!fileset_filename_match_pattern(name)) {
+               return NULL;
+       }
 
     /* find char position behind the last underscore */
     pfx = strrchr(name, '_');
@@ -169,11 +171,15 @@ fileset_dlg_add_file(fileset_entry *entry) {
         return;
     }
 
-    /*local = localtime(&entry->ctime);
-    created = g_strdup_printf("%04u.%02u.%02u %02u:%02u:%02u", 
-        local->tm_year+1900, local->tm_mon+1, local->tm_mday,
-        local->tm_hour, local->tm_min, local->tm_sec);*/
     created = fileset_dlg_name2date_dup(entry->name);
+       if(!created) {
+               /* if this file doesn't follow the fiel set pattern, */
+               /* use the creation time of that file */
+               local = localtime(&entry->ctime);
+               created = g_strdup_printf("%04u.%02u.%02u %02u:%02u:%02u", 
+                       local->tm_year+1900, local->tm_mon+1, local->tm_mday,
+                       local->tm_hour, local->tm_min, local->tm_sec);
+       }
 
     local = localtime(&entry->mtime);
     modified = g_strdup_printf("%04u.%02u.%02u %02u:%02u:%02u",