From b571ec842a562be9f073f7d47751a90d836f44ec Mon Sep 17 00:00:00 2001 From: Micke Nordin Date: Wed, 31 Aug 2022 15:51:30 +0200 Subject: [PATCH] Fix CLI --actions="..." confused by trailing semicolon This patch adds a check for an empty, or white space only, action. If the action is empty or white space only, we simply continue the loop. The whitespace we account for is: * space (0x20, ' ') * form feed (0x0c, '\f') * line feed (0x0a, '\n') * carriage return (0x0d, '\r') * horizontal tab (0x09, '\t') * vertical tab (0x0b, '\v') Fixes https://gitlab.com/inkscape/inkscape/-/issues/3480 --- src/inkscape-application.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/inkscape-application.cpp b/src/inkscape-application.cpp index 046531b3ea..229b395663 100644 --- a/src/inkscape-application.cpp +++ b/src/inkscape-application.cpp @@ -1133,6 +1133,9 @@ InkscapeApplication::parse_actions(const Glib::ustring& input, action_vector_t& if (tokens2.size() > 0) { action = tokens2[0]; } + if (action.find_first_not_of(" \f\n\r\t\v") == std::string::npos) { + continue; + } if (tokens2.size() > 1) { value = tokens2[1]; } -- GitLab