fix: line + cmd is support

This commit is contained in:
starnakin 2023-07-26 14:34:34 +02:00
parent 7d48af93de
commit 29c6b66b17

View File

@ -37,7 +37,7 @@ parsing(text, cmd_ptr)
if (strcmp(tmp, "") == 0) if (strcmp(tmp, "") == 0)
[cmd_ptr] = strdup("p"); [cmd_ptr] = strdup("p");
else else
[cmd_ptr] = strdup(input); [cmd_ptr] = strdup(tmp);
free(input); free(input);
if ([cmd_ptr] == NULL) if ([cmd_ptr] == NULL)
return 1; return 1;
@ -71,6 +71,8 @@ main()
cmd_add(text, NULL); cmd_add(text, NULL);
else if (strcmp(cmd, "p") == 0) else if (strcmp(cmd, "p") == 0)
cmd_print(text, NULL); cmd_print(text, NULL);
else if (strcmp(cmd, "n") == 0)
cmd_numbered(text, NULL);
free(cmd); free(cmd);
} }
} }