diff options
| author | Dirk-Jan C. Binnema <djcb@djcbsoftware.nl> | 2026-03-07 15:49:44 +0200 |
|---|---|---|
| committer | Dirk-Jan C. Binnema <djcb@djcbsoftware.nl> | 2026-03-07 15:49:44 +0200 |
| commit | 7cf54aa5dddcd4573685c0cbef929f4e1b5705ed (patch) | |
| tree | d6ff92a1d7dc63dd8d67b5e77cf37a62a76c7e4a /mu | |
| parent | 2564720b98bcc713652d1ae16910593b6e9fe256 (diff) | |
mu/lib: fix some possible quoting issues
Diffstat (limited to 'mu')
| -rw-r--r-- | mu/mu-cmd-find.cc | 3 | ||||
| -rw-r--r-- | mu/mu-options.cc | 7 |
2 files changed, 4 insertions, 6 deletions
diff --git a/mu/mu-cmd-find.cc b/mu/mu-cmd-find.cc index d4c7e17..a85bdc8 100644 --- a/mu/mu-cmd-find.cc +++ b/mu/mu-cmd-find.cc @@ -116,8 +116,7 @@ exec_cmd(const Option<Message>& msg, const OutputInfo& info, const Options& opts int wait_status{}; GError *err{}; - auto cmdline{mu_format("{} {}", opts.find.exec, - to_string_gchar(g_shell_quote(msg->path().c_str())))}; + auto cmdline{mu_format("{} {}", opts.find.exec, shell_quote(msg->path()))}; if (!g_spawn_command_line_sync(cmdline.c_str(), {}, {}, &wait_status, &err)) return Err(Error::Code::File, &err/*consumed*/, diff --git a/mu/mu-options.cc b/mu/mu-options.cc index 2c51839..4051881 100644 --- a/mu/mu-options.cc +++ b/mu/mu-options.cc @@ -1,5 +1,5 @@ /* -** Copyright (C) 2022-2025 Dirk-Jan C. Binnema <djcb@djcbsoftware.nl> +** Copyright (C) 2022-2026 Dirk-Jan C. Binnema <djcb@djcbsoftware.nl> ** ** This program is free software; you can redistribute it and/or modify it ** under the terms of the GNU General Public License as published by the @@ -140,8 +140,7 @@ to_enum(const IE& ie, std::string_view name) { for(auto&& item: ie) if (item.second.first == name) return item.first; - else - return Nothing; + return Nothing; } /** @@ -828,7 +827,7 @@ show_manpage(Options& opts, const std::string& name) "cannot find 'man' program"); GError* err{}; - const auto cmd{mu_format("{} {}", *manprog, name)}; + const auto cmd{mu_format("{} {}", *manprog, shell_quote(name))}; // run_command0 doesn't work here. auto res = g_spawn_command_line_sync(cmd.c_str(), {}, {}, {}, &err); if (!res) |
