Skip to content

dadd: invalid option -- 0 errors on OpenBSD when days/months/years to keep are set to 1 #1

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
morgant opened this issue Mar 14, 2020 · 2 comments
Assignees
Labels
bug Something isn't working
Milestone

Comments

@morgant
Copy link
Owner

morgant commented Mar 14, 2020

On OpenBSD, which uses dateutils, we get the following error multiple times if days, months, or years to keep are set to 1 in the config file:

dadd: invalid option -- 0

This is because reldate() is called with days/months/years to keep less one, which would be zero, so reldate is calling dadd with an adjustment of -0d or -0m or -0y, which results in the error.

@morgant morgant self-assigned this Mar 14, 2020
@morgant morgant added the bug Something isn't working label Mar 14, 2020
@morgant morgant added this to the 0.1.11 milestone Mar 14, 2020
@morgant
Copy link
Owner Author

morgant commented Mar 14, 2020

I think we can probably work around this by detecting a zero adjustment and just using date in that particular case.

@morgant
Copy link
Owner Author

morgant commented Apr 5, 2020

Fixed by checking for zero offset in reldate()'s OpenBSD case and just using date instead of dadd as a we don't need to apply an offset anyway.

@morgant morgant closed this as completed Apr 5, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant