On Sun, Nov 28, 2021 at 10:22:54PM +0100, viverna wrote:
> On Sun, 28 Nov 2021 05:22:46 -0500 Thomas Dickey <[email protected]> wrote:
> > On Sat, Nov 27, 2021 at 10:13:47PM +0100, viverna wrote:
> > > Package: dialog
> > > Version: 1.3-20201126-1
> > > Severity: normal
> > > 
> > > Dear maintainer,
> > > I have found a bug in dialog package. Bug appears generally when day
> > > selected and next month than that user selected don't exist.
> > 
> > That's correct (and intentional) behavior.  dialog won't return an invalid
> > date.  The manual page could be clearer
> > 
> >       --calendar text height width day month year
> >              A calendar box  displays  month,  day  and  year  in  
> > separately
> >              adjustable  windows.   If  the values for day, month or year 
> > are
> >              missing or negative, the current date's corresponding values 
> > are
> >              used.   You  can  increment  or decrement any of those using 
> > the
> >              left-, up-, right-, and down-arrows.  Use vi-style h, j, k and 
> > l
> >              for  moving  around  the  array  of days in a month.  Use tab 
> > or
> >              backtab to move between windows.  If the year is given as  
> > zero,
> >              the current date is used as an initial value.
> > 
> > but there's no code-change to make.
> > 
> > -- 
> > Thomas E. Dickey <[email protected]>
> > https://invisible-island.net
> > ftp://ftp.invisible-island.net
> I downloaded most recent dialog Version: 1.3-20211107.
> I do: configure && make
> Then run it and calendar don't selected correct date if triplet
> "day month year" is valid but triplet "day month+1 year" is invalid.
> 
> For example:
> When passing last 3 parameters 31 1 2021 in calendar box:
> - day:31 month:1 year:2021 is valid date
> and I expect dialog offer it as default in the calendar box.
> 
>       dialog --calendar "text" 10 40 31 1 2021
> 
> I expect dialog appear as default day 31 because this is a valid date.
> But this does not happen because day:31 month:1+1=2 (February) year:2021 is
> invalid.
> 
> I then applied a patch in my calendar.c in the dialog source:
> 
> patch calendar.c patch
> 
> ##### patch #####
> 760c760
> <                                      current.tm_mon + 1)) {
> ---
> >                                      current.tm_mon)) {
> ##### patch #####
> 
> It works for me. Since I am not an expert I ask if it is possible to
> consider to test this patch.

I see - thanks (will review and see if there are other occurrences)

-- 
Thomas E. Dickey <[email protected]>
https://invisible-island.net
ftp://ftp.invisible-island.net

Attachment: signature.asc
Description: PGP signature

Reply via email to