From 2d7288effa9b3a59da614f9e8f82f355b0e481ee Mon Sep 17 00:00:00 2001 From: Rasmus Buurman Date: Tue, 6 Aug 2024 15:56:08 +0200 Subject: [PATCH] Canonicalize init --maildir argument after expanding Ensure that `maildir` is an absolute and _canonical_ path when user passes a custom maildir path using `mu init --maildir PATH` --- mu/mu-options.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/mu/mu-options.cc b/mu/mu-options.cc index 9533e9cc4..d01c824e2 100644 --- a/mu/mu-options.cc +++ b/mu/mu-options.cc @@ -459,7 +459,8 @@ sub_init(CLI::App& sub, Options& opts) sub.add_option("--maildir,-m", opts.init.maildir, "Top of the maildir") ->type_name("") ->default_val(default_mdir) - ->transform(ExpandPath, "expand maildir path"); + ->transform(ExpandPath, "expand maildir path") + ->transform(CanonicalizePath, "canonicalize maildir path"); sub.add_option("--my-address", opts.init.my_addresses, "Personal e-mail address or regexp") ->type_name("
");