diff options
author | Jaakko Keränen <jaakko.keranen@iki.fi> | 2020-07-26 14:32:02 +0300 |
---|---|---|
committer | Jaakko Keränen <jaakko.keranen@iki.fi> | 2020-07-26 14:32:02 +0300 |
commit | deba8cc58be7511ede63d0b6417c739e8e35b176 (patch) | |
tree | 8fd4fa925a5f851c35e558b012bb003131981af7 /src/ui/command.c | |
parent | c8a7d28f61ab53d841efe38ddcf34be0db3104d9 (diff) |
Asking the user for input
Diffstat (limited to 'src/ui/command.c')
-rw-r--r-- | src/ui/command.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/ui/command.c b/src/ui/command.c index 71228784..b79c8bcf 100644 --- a/src/ui/command.c +++ b/src/ui/command.c | |||
@@ -51,7 +51,7 @@ void *pointer_Command(const char *cmd) { | |||
51 | return pointerLabel_Command(cmd, "ptr"); | 51 | return pointerLabel_Command(cmd, "ptr"); |
52 | } | 52 | } |
53 | 53 | ||
54 | const char *valuePtr_Command(const char *cmd, const char *label) { | 54 | const char *suffixPtr_Command(const char *cmd, const char *label) { |
55 | const iString *tok = tokenString_(label); | 55 | const iString *tok = tokenString_(label); |
56 | const char *ptr = strstr(cmd, cstr_String(tok)); | 56 | const char *ptr = strstr(cmd, cstr_String(tok)); |
57 | if (ptr) { | 57 | if (ptr) { |
@@ -60,8 +60,12 @@ const char *valuePtr_Command(const char *cmd, const char *label) { | |||
60 | return NULL; | 60 | return NULL; |
61 | } | 61 | } |
62 | 62 | ||
63 | iString *suffix_Command(const char *cmd, const char *label) { | ||
64 | return newCStr_String(suffixPtr_Command(cmd, label)); | ||
65 | } | ||
66 | |||
63 | const iString *string_Command(const char *cmd, const char *label) { | 67 | const iString *string_Command(const char *cmd, const char *label) { |
64 | iRangecc val = { valuePtr_Command(cmd, label), NULL }; | 68 | iRangecc val = { suffixPtr_Command(cmd, label), NULL }; |
65 | if (val.start) { | 69 | if (val.start) { |
66 | for (val.end = val.start; *val.end && !isspace(*val.end); val.end++) {} | 70 | for (val.end = val.start; *val.end && !isspace(*val.end); val.end++) {} |
67 | return collect_String(newRange_String(val)); | 71 | return collect_String(newRange_String(val)); |