X-Git-Url: https://git.notmuchmail.org/git?p=notmuch;a=blobdiff_plain;f=notmuch-config.c;h=befe9b5b5c8a45a084d7a3fd2738b5344fa4a7bb;hp=d9c2eb3fe65957917bef62bfab61dbe74da32a8a;hb=8c3d19313e590590db3ecfe0fb7177f4f6aee023;hpb=58ed67992d0ec1fa505026105218fa449f7980b0 diff --git a/notmuch-config.c b/notmuch-config.c index d9c2eb3f..befe9b5b 100644 --- a/notmuch-config.c +++ b/notmuch-config.c @@ -456,10 +456,19 @@ notmuch_config_save (notmuch_config_t *config) /* Try not to overwrite symlinks. */ filename = realpath (config->filename, NULL); if (! filename) { - fprintf (stderr, "Error canonicalizing %s: %s\n", config->filename, - strerror (errno)); - g_free (data); - return 1; + if (errno == ENOENT) { + filename = strdup (config->filename); + if (! filename) { + fprintf (stderr, "Out of memory.\n"); + g_free (data); + return 1; + } + } else { + fprintf (stderr, "Error canonicalizing %s: %s\n", config->filename, + strerror (errno)); + g_free (data); + return 1; + } } if (! g_file_set_contents (filename, data, length, &error)) {