Skip to content

Commit d49a360

Browse files
stephanboschsirainen
authored andcommitted
test-exec - Use str_begins_icase() in test_send_next_command()
1 parent 58cbdb9 commit d49a360

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/test-exec.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -856,7 +856,7 @@ static void test_send_next_command(struct test_exec_context *ctx,
856856
struct test_command *test_cmd)
857857
{
858858
struct command *cmd = NULL;
859-
const char *cmdline;
859+
const char *cmdline, *args;
860860
unsigned int cmdline_len;
861861

862862
cmdline = test_cmd->command;
@@ -866,10 +866,10 @@ static void test_send_next_command(struct test_exec_context *ctx,
866866
client->client.state = STATE_APPEND;
867867
(void)imap_client_append_full(client, NULL, NULL, NULL,
868868
test_cmd_callback, &cmd);
869-
} else if (strncasecmp(cmdline, "append ", 7) == 0 &&
870-
!append_has_body(ctx, cmdline+7, cmdline_len-7)) {
869+
} else if (str_begins_icase(cmdline, "append ", &args) &&
870+
!append_has_body(ctx, args, strlen(args))) {
871871
client->client.state = STATE_APPEND;
872-
(void)imap_client_append(client, cmdline + 7, FALSE,
872+
(void)imap_client_append(client, args, FALSE,
873873
test_cmd_callback, &cmd);
874874
} else {
875875
if (test_cmd->linenum == 0 ||

0 commit comments

Comments
 (0)