]> git.notmuchmail.org Git - notmuch/blobdiff - date.c
Hook up our fancy new notmuch_parse_date function.
[notmuch] / date.c
diff --git a/date.c b/date.c
index 7fdbb7101cf4d447ec649f225ef512cbc5c84af8..c116bbd5f432f54dfa41b6aa991a0caccdd0b972 100644 (file)
--- a/date.c
+++ b/date.c
@@ -27,6 +27,8 @@
 
 #include <time.h>
 
+#include <glib.h> /* For g_ascii_strncasecmp only. */
+
 #ifndef FALSE
 #define FALSE 0
 #endif
@@ -643,12 +645,15 @@ notmuch_parse_date (const char *str, int *tz_offset)
 {
        date_token *token, *tokens;
        time_t date;
-       
+
+       if (str == NULL)
+               return 0;
+
        if (!(tokens = datetok (str))) {
                if (tz_offset)
                        *tz_offset = 0;
                
-               return (time_t) 0;
+               return 0;
        }
        
        if (!(date = parse_rfc822_date (tokens, tz_offset)))