ddate icon indicating copy to clipboard operation
ddate copied to clipboard

Crashes on St. Tib's day

Open TobiX opened this issue 8 years ago • 3 comments

Well, okay, only with "invalid" format string, but this

ddate "+%}%{" 29 2 2012

creates an endless loop (or anything else resulting in tib_end < tib_start like %A%e).

suggestions:

in line 262:

if(tib_start>=0)    tib_end=i+1;

after the first loop, add a sanity check:

if (tib_end < tib_start) tib_end = tib_start + 1;

This will probably fix half of the only bug documented in the man page ;)

TobiX avatar Mar 01 '16 22:03 TobiX

I've fixed this, I believe, over at https://github.com/escondida/ddate . I'd initially planned to do a proper pull request (even started with a different one), but since this repo seems to be abandoned, I've just forked for now. If it revives...great. Otherwise, schism is an act of worship.

escondida avatar Mar 26 '20 17:03 escondida

As a side note, I've fixed the "undefined" behavior when you ask for, say, the weekday name or day number on St. Tib's Day but didn't include %{ beforehand.

escondida avatar Mar 26 '20 17:03 escondida

I presume this is indeed the official repo which gets pulled into most distributions' build systems...

danwdart avatar Aug 19 '21 18:08 danwdart