]> asedeno.scripts.mit.edu Git - git.git/blobdiff - imap-send.c
Add compat/fopen.c which returns NULL on attempt to open directory
[git.git] / imap-send.c
index e95cdde062b0741fa8c73ddc87ada2fbfab8921f..9025d9aa3ef37b1a1ce4ae5d4b447e3b0918cb7e 100644 (file)
@@ -1180,7 +1180,7 @@ read_message( FILE *f, msg_data_t *msg )
        } while (!feof(f));
 
        msg->len  = buf.len;
-       msg->data = strbuf_detach(&buf);
+       msg->data = strbuf_detach(&buf, NULL);
        return msg->len;
 }
 
@@ -1254,6 +1254,10 @@ git_imap_config(const char *key, const char *val)
 
        if (strncmp( key, imap_key, sizeof imap_key - 1 ))
                return 0;
+
+       if (!val)
+               return config_error_nonbool(key);
+
        key += sizeof imap_key - 1;
 
        if (!strcmp( "folder", key )) {