Skip to content
This repository was archived by the owner on Apr 17, 2020. It is now read-only.
This repository was archived by the owner on Apr 17, 2020. It is now read-only.

Empty lines in output of "exec" command cause "Not enough parameters given" errors #902

@irssibot

Description

@irssibot

If a command is run by the exec function with output to the channel (i. e. /exec -o), empty lines in the process output will cause an error ("Not enough parameters given") because the "command msg" signal expects three parameters but only receives two.

In normal chat mode, an empty line is caught and ignored in the function "event_text":

irssi-0.8.16-rc1/src/fe-common/core/chat-completion.c (1065ff)
    if (*data == '\0') {
        /* empty line, forget it. */
                signal_stop();
        return;
    }

For exec, there's no test for the length of the string (function sig_exec_input).
In some cases (no -o option used) empty lines are OK, but when the output is sent to the channel, it will fail.

It is not completely obvious to me what the correct behaviour should be.
Possible options:

  • Ignore empty lines (like above, but it would have to be done within if (rec->target != NULL) { } to make sure it doesn't remove blank lines from local output).
  • Send a line with just a space character instead of the empty line.

The latter would probably give the "expected" behaviour (at least visually).

Diff of proposed patch attached.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions