aboutsummaryrefslogtreecommitdiff
path: root/qlop.c
diff options
context:
space:
mode:
Diffstat (limited to 'qlop.c')
-rw-r--r--qlop.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/qlop.c b/qlop.c
index 1d4e0d9..7bac8c2 100644
--- a/qlop.c
+++ b/qlop.c
@@ -758,8 +758,17 @@ parse_date(const char *sdate, time_t *t)
char ago[len];
int ret = sscanf(sdate, "%lu %s %s", &num, dur, ago);
- if (ret < 2)
- return false;
+ if (ret < 2) {
+ if (strcmp(sdate, "today") == 0) {
+ num = 0;
+ snprintf(dur, len, "%s", "day");
+ } else if (strcmp(sdate, "yesterday") == 0) {
+ num = 1;
+ snprintf(dur, len, "%s", "day");
+ } else {
+ return false;
+ }
+ }
if (ret == 3 && strcmp(ago, "ago") != 0)
return false;