aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--notmuch-config.c17
-rwxr-xr-xtest/setup1
2 files changed, 13 insertions, 5 deletions
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)) {
diff --git a/test/setup b/test/setup
index 8cc55767..124ef1c8 100755
--- a/test/setup
+++ b/test/setup
@@ -4,7 +4,6 @@ test_description='"notmuch setup"'
. ./test-lib.sh
test_begin_subtest "Create a new config interactively"
-test_subtest_known_broken
notmuch --config=new-notmuch-config > /dev/null <<EOF
Test Suite
test.suite@example.com