forked from systemd/systemd
-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
calendarspec: be more graceful with two kinds of calendar expressions
This changes the calendarspec parser to allow expressions such as "00:05..05", i.e. a range where start and end is the same. It also allows expressions such as "00:1-2/3", i.e. where the repetition value does not fit even once in the specified range. With this patch both cases will now be optimized away, i.e. the range is removed and a fixed value is used, which is functionally equivalent. See systemd#15030 for an issue where the inability to parse such expressions caused confusion. I think it's probably better to accept these gracefully and optimizing them away instead of refusing them with a plain EINVAL. With a tool such as "systemd-analyze" calendar it should be easy to figure out the normalized form with the redundant bits optimized away.
- Loading branch information
1 parent
6d0b218
commit e4cac01
Showing
2 changed files
with
18 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters