From af5c3afa91cc29268c6754ea70f15cae30f22403 Mon Sep 17 00:00:00 2001 From: David Bremner Date: Mon, 27 Jan 2014 10:12:12 -0400 Subject: compat: add canonicalize_file_name the POSIX 2008 behaviour of realpath is not available everywhere so we provide a simple wrapper function. We use (and provide) the gnu extension canonicalize_file_name to make it cleaner to test for the feature we need; otherwise we have to rely on realpath segfaulting if the second argument is null. --- notmuch-config.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'notmuch-config.c') diff --git a/notmuch-config.c b/notmuch-config.c index 8d286538..4886d366 100644 --- a/notmuch-config.c +++ b/notmuch-config.c @@ -454,7 +454,7 @@ notmuch_config_save (notmuch_config_t *config) } /* Try not to overwrite symlinks. */ - filename = realpath (config->filename, NULL); + filename = canonicalize_file_name (config->filename); if (! filename) { if (errno == ENOENT) { filename = strdup (config->filename); -- cgit v1.2.3