summaryrefslogtreecommitdiffstats
path: root/src/ui-day.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/ui-day.c')
-rw-r--r--src/ui-day.c21
1 files changed, 9 insertions, 12 deletions
diff --git a/src/ui-day.c b/src/ui-day.c
index 5907490..c90edc1 100644
--- a/src/ui-day.c
+++ b/src/ui-day.c
@@ -366,9 +366,11 @@ static void update_rept(struct rpt **rpt, const long start)
mem_free(timstr);
timstr = date_sec2date_str((*rpt)->until, DATEFMT(conf.input_datefmt));
status_mesg(msg_until_1, "");
- if (updatestring(win[STA].p, &timstr, 0, 1) !=
- GETSTRING_VALID) {
+ if (updatestring(win[STA].p, &timstr, 0, 1) == GETSTRING_ESC)
goto cleanup;
+ if (strcmp(timstr, "") == 0 || strcmp(timstr, "0") == 0) {
+ newuntil = 0;
+ break;
}
if (*(timstr + strlen(timstr) - 1) == '?') {
mem_free(outstr);
@@ -377,10 +379,6 @@ static void update_rept(struct rpt **rpt, const long start)
keys_wgetch(win[KEY].p);
continue;
}
- if (strcmp(timstr, "0") == 0) {
- newuntil = 0;
- break;
- }
if (*timstr == '+') {
unsigned days;
if (!parse_date_duration(timstr + 1, &days, start)) {
@@ -905,9 +903,12 @@ void ui_day_item_repeat(void)
char *outstr, *datestr;
for (;;) {
status_mesg(mesg_until_1, "");
- if (getstring(win[STA].p, user_input, BUFSIZ, 0, 1) !=
- GETSTRING_VALID)
+ if (getstring(win[STA].p, user_input, BUFSIZ, 0, 1) == GETSTRING_ESC)
goto cleanup;
+ if (strcmp(user_input, "") == 0 || strcmp(user_input, "0") == 0) {
+ until = 0;
+ break;
+ }
if (*user_input == '?') {
user_input[0] = '\0';
asprintf(&outstr, mesg_help_1, DATEFMT_DESC(conf.input_datefmt));
@@ -916,10 +917,6 @@ void ui_day_item_repeat(void)
wgetch(win[KEY].p);
continue;
}
- if (strcmp(user_input, "0") == 0) {
- until = 0;
- break;
- }
if (*user_input == '+') {
if (!parse_date_duration(user_input + 1, &days, p->start)) {
status_mesg(mesg_wrong_1, mesg_wrong_2);