diff options
author | pommicket <pommicket@gmail.com> | 2023-03-23 13:55:50 -0400 |
---|---|---|
committer | pommicket <pommicket@gmail.com> | 2023-03-23 13:55:50 -0400 |
commit | eb088ebd059ba00735723fb394d3bfe1b3530026 (patch) | |
tree | d7bfedce0a1f859ba89525afe1ae6a1afce427ae /menu.c | |
parent | 63f54d13aa7233986f784ef857faef259a889ed6 (diff) |
get rid of ARG_STRING, start macros
Diffstat (limited to 'menu.c')
-rw-r--r-- | menu.c | 12 |
1 files changed, 9 insertions, 3 deletions
@@ -289,9 +289,15 @@ void menu_update(Ted *ted) { Command c = command_from_str(chosen_command); if (c != CMD_UNKNOWN) { char *argument = str32_to_utf8_cstr(buffer_get_line(&ted->argument_buffer, 0)), *endp = NULL; - long long arg = strtoll(argument, &endp, 0); - - if (*endp == '\0') { + long long arg = 1; + bool execute = true; + if (*argument) { + strtoll(argument, &endp, 0); + if (*endp != '\0') + execute = false; + } + + if (execute) { menu_close(ted); command_execute(ted, c, arg); } |