]> git.notmuchmail.org Git - notmuch/blobdiff - notmuch-config.c
notmuch new: Don't ignore files with mtime of 0.
[notmuch] / notmuch-config.c
index f7313bfaa055d300114845e0375308ddf1ff9cfa..248149c85de0ee0401816537ce84b1adad5a88f0 100644 (file)
@@ -145,10 +145,15 @@ get_username_from_passwd_file (void *ctx)
  * in editing the file directly.
  */
 notmuch_config_t *
-notmuch_config_open (void *ctx, const char *filename)
+notmuch_config_open (void *ctx,
+                    const char *filename,
+                    notmuch_bool_t *is_new_ret)
 {
     GError *error = NULL;
-    int config_file_is_new = 0;
+    int is_new = 0;
+
+    if (is_new_ret)
+       *is_new_ret = 0;
 
     notmuch_config_t *config = talloc (ctx, notmuch_config_t);
     if (config == NULL) {
@@ -188,7 +193,7 @@ notmuch_config_open (void *ctx, const char *filename)
            return NULL;
        }
 
-       config_file_is_new = 1;
+       is_new = 1;
     }
 
     if (notmuch_config_get_database_path (config) == NULL) {
@@ -236,7 +241,7 @@ notmuch_config_open (void *ctx, const char *filename)
 
     /* When we create a new configuration file here, we  add some
      * comments to help the user understand what can be done. */
-    if (config_file_is_new) {
+    if (is_new) {
        g_key_file_set_comment (config->key_file, NULL, NULL,
                                toplevel_config_comment, NULL);
        g_key_file_set_comment (config->key_file, "database", NULL,
@@ -245,6 +250,9 @@ notmuch_config_open (void *ctx, const char *filename)
                                user_config_comment, NULL);
     }
 
+    if (is_new_ret)
+       *is_new_ret = is_new;
+
     return config;
 }