Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix .tcl server add/remove arg parsing #1722

Open
wants to merge 2 commits into
base: develop
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions src/mod/server.mod/tclserv.c
Original file line number Diff line number Diff line change
Expand Up @@ -582,6 +582,10 @@ static int tcl_server STDVAR {

BADARGS(2, 5, " subcommand ?host ?port? ?password?");
if (!strcmp(argv[1], "add")) {
if (argc < 3) {
Tcl_SetResult(irp, "Subcommand add needs at least a server host", TCL_STATIC);
michaelortmann marked this conversation as resolved.
Show resolved Hide resolved
return TCL_ERROR;
}
ret = add_server(argv[2], argc >= 4 && argv[3] ? argv[3] : "", argc >= 5 && argv[4] ? argv[4] : "");
if (!ret) {
server = Tcl_NewListObj(0, NULL);
Expand All @@ -599,6 +603,10 @@ static int tcl_server STDVAR {
Tcl_SetObjResult(irp, server);
}
} else if (!strcmp(argv[1], "remove")) {
if (argc < 3) {
Tcl_SetResult(irp, "Subcommand remove needs at least a server host", TCL_STATIC);
michaelortmann marked this conversation as resolved.
Show resolved Hide resolved
return TCL_ERROR;
}
ret = del_server(argv[2], argc >= 4 && argv[3] ? argv[3] : "");
} else if (!strcmp(argv[1], "list")) {
Tcl_Obj *servers = Tcl_NewListObj(0, NULL);
Expand Down
Loading