]> git.sesse.net Git - plocate/commitdiff
Replace canonicalize_file_name() with realpath().
authorSteinar H. Gunderson <steinar+git@gunderson.no>
Mon, 23 Aug 2021 15:53:34 +0000 (17:53 +0200)
committerSteinar H. Gunderson <steinar+git@gunderson.no>
Mon, 23 Aug 2021 15:54:34 +0000 (17:54 +0200)
canonicalize_file_name() is a GNU extension, while realpath() is POSIX.
Seemingly needed for musl. Adapted from the Void Linux repository.

conf.cpp

index abea68a4f328ae89b9ffed74ddcd5b643e594416..695af67823212b0a0088488ac94f74f7de05ef5a 100644 (file)
--- 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");