mu: allow relative message paths in mu commands

This commit is contained in:
Dirk-Jan C. Binnema
2023-04-04 23:24:18 +03:00
parent 6f2c934d72
commit cd23e6015d
4 changed files with 13 additions and 14 deletions

View File

@ -156,12 +156,7 @@ handle_msg(const std::string& fname, const Options& opts)
{
using Format = Options::View::Format;
// make absolute.
const auto fpath{to_string_opt_gchar(g_canonicalize_filename(fname.c_str(), NULL))};
if (!fpath)
return Err(Error::Code::File, "invalid file '%s'", fname.c_str());
auto message{Message::make_from_path(*fpath, message_options(opts.view))};
auto message{Message::make_from_path(fname, message_options(opts.view))};
if (!message)
return Err(message.error());

View File

@ -40,7 +40,7 @@ template<typename CmdOpts>
constexpr Message::Options
message_options(const CmdOpts& cmdopts)
{
Message::Options mopts{};
Message::Options mopts{Message::Options::AllowRelativePath};
if (cmdopts.decrypt)
mopts |= Message::Options::Decrypt;