mirror of
https://github.com/systemd/systemd.git
synced 2026-08-05 07:30:30 +00:00
time-util: drop redundant else
This commit is contained in:
@@ -665,21 +665,23 @@ static int parse_timestamp_impl(const char *t, usec_t *ret, bool with_tz) {
|
||||
if (streq(t, "now"))
|
||||
goto finish;
|
||||
|
||||
else if (t[0] == '+') {
|
||||
if (t[0] == '+') {
|
||||
r = parse_sec(t+1, &plus);
|
||||
if (r < 0)
|
||||
return r;
|
||||
|
||||
goto finish;
|
||||
}
|
||||
|
||||
} else if (t[0] == '-') {
|
||||
if (t[0] == '-') {
|
||||
r = parse_sec(t+1, &minus);
|
||||
if (r < 0)
|
||||
return r;
|
||||
|
||||
goto finish;
|
||||
}
|
||||
|
||||
} else if ((k = endswith(t, " ago"))) {
|
||||
if ((k = endswith(t, " ago"))) {
|
||||
t = strndupa_safe(t, k - t);
|
||||
|
||||
r = parse_sec(t, &minus);
|
||||
@@ -687,8 +689,9 @@ static int parse_timestamp_impl(const char *t, usec_t *ret, bool with_tz) {
|
||||
return r;
|
||||
|
||||
goto finish;
|
||||
}
|
||||
|
||||
} else if ((k = endswith(t, " left"))) {
|
||||
if ((k = endswith(t, " left"))) {
|
||||
t = strndupa_safe(t, k - t);
|
||||
|
||||
r = parse_sec(t, &plus);
|
||||
|
||||
Reference in New Issue
Block a user