=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/tmux/cmd-parse.y,v retrieving revision 1.20 retrieving revision 1.21 diff -c -r1.20 -r1.21 *** src/usr.bin/tmux/cmd-parse.y 2019/10/14 08:38:07 1.20 --- src/usr.bin/tmux/cmd-parse.y 2019/12/12 15:01:54 1.21 *************** *** 1,4 **** ! /* $OpenBSD: cmd-parse.y,v 1.20 2019/10/14 08:38:07 nicm Exp $ */ /* * Copyright (c) 2019 Nicholas Marriott --- 1,4 ---- ! /* $OpenBSD: cmd-parse.y,v 1.21 2019/12/12 15:01:54 nicm Exp $ */ /* * Copyright (c) 2019 Nicholas Marriott *************** *** 746,751 **** --- 746,757 ---- struct cmd_parse_result * cmd_parse_from_string(const char *s, struct cmd_parse_input *pi) { + return (cmd_parse_from_buffer(s, strlen(s), pi)); + } + + struct cmd_parse_result * + cmd_parse_from_buffer(const void *buf, size_t len, struct cmd_parse_input *pi) + { static struct cmd_parse_result pr; struct cmd_parse_input input; struct cmd_parse_commands *cmds; *************** *** 757,770 **** } memset(&pr, 0, sizeof pr); ! if (*s == '\0') { pr.status = CMD_PARSE_EMPTY; pr.cmdlist = NULL; pr.error = NULL; return (&pr); } ! cmds = cmd_parse_do_buffer(s, strlen(s), pi, &cause); if (cmds == NULL) { pr.status = CMD_PARSE_ERROR; pr.error = cause; --- 763,776 ---- } memset(&pr, 0, sizeof pr); ! if (len == 0) { pr.status = CMD_PARSE_EMPTY; pr.cmdlist = NULL; pr.error = NULL; return (&pr); } ! cmds = cmd_parse_do_buffer(buf, len, pi, &cause); if (cmds == NULL) { pr.status = CMD_PARSE_ERROR; pr.error = cause;