From: Steinar H. Gunderson Date: Mon, 23 Aug 2021 15:53:34 +0000 (+0200) Subject: Replace canonicalize_file_name() with realpath(). X-Git-Tag: 1.1.10~6 X-Git-Url: https://git.sesse.net/?p=plocate;a=commitdiff_plain;h=eea49b33b014cd4f3c83a9ac73c89a4807e18d61 Replace canonicalize_file_name() with realpath(). canonicalize_file_name() is a GNU extension, while realpath() is POSIX. Seemingly needed for musl. Adapted from the Void Linux repository. --- diff --git a/conf.cpp b/conf.cpp index abea68a..695af67 100644 --- a/conf.cpp +++ b/conf.cpp @@ -479,7 +479,7 @@ parse_arguments(int argc, char *argv[]) if (conf_scan_root != NULL) error(EXIT_FAILURE, 0, _("--%s specified twice"), "database-root"); - conf_scan_root = canonicalize_file_name(optarg); + conf_scan_root = realpath(optarg, nullptr); if (conf_scan_root == NULL) error(EXIT_FAILURE, errno, _("invalid value `%s' of --%s"), optarg, "database-root");