gtimezone: fix parsing of Julian day in POSIX TZ format

The timezone(3) man page on Fedora 31 describes the start/end
field in the POSIX TZ format as follows:

[quote]
   The start field specifies when daylight  saving  time  goes
   into  effect and the end field specifies when the change is
   made back to standard time.  These fields may have the fol‐
   lowing formats:

   Jn     This  specifies  the Julian day with n between 1 and
          365.  Leap days are not counted.   In  this  format,
          February 29 can't be represented; February 28 is day
          59, and March 1 is always day 60.

   n      This specifies the  zero-based  Julian  day  with  n
          between  0  and 365.  February 29 is counted in leap
          years.

   Mm.w.d This specifies day d (0 <= d <= 6) of week w (1 <= w
          <=  5)  of  month  m  (1 <= m <= 12).  Week 1 is the
          first week in which day d occurs and week 5  is  the
          last week in which day d occurs.  Day 0 is a Sunday.
[/quote]

The GTimeZone code does not correctly parse the 'n' syntax,
treating it as having the range 1-365, the same as the 'Jn'
syntax. This is semantically broken as it makes it impossible
to represent the 366th day, which is the purpose of the 'n'
syntax.

There is a code comment saying this was done because the Linux
semantics are different from zOS and BSD. This is not correct,
as GLibC does indeed use the same 0-365 range as other operating
systems. It is believed that the original author was mislead by
a bug in old versions of the Linux libc timezone(3) man pages
which was fixed in

  commit 5a554f8e525faa98354c1b95bfe4aca7125a3657
  Author: Peter Schiffer <pschiffe@redhat.com>
  Date:   Sat Mar 24 16:08:10 2012 +1300

    tzset.3: Correct description for Julian 'n' date format

    The Julian 'n' date format counts atrting from 0, not 1.

    Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>

Fixes: #1999

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
12 jobs for backport-1314-tz-parsing-glib-2-62 in 46 minutes and 8 seconds (queued for 2 seconds)
Status Job ID Name Coverage
  Build
passed #556358
cross-android_api21_arm64

00:01:14

passed #556359
cross-android_api28_arm64

00:01:21

passed #556360
cross-mingw64

00:02:28

passed #556356
debian-stable-x86_64

00:04:17

passed #556426
fedora-x86_64

00:03:45

passed #556357
G_DISABLE_ASSERT

00:02:54

passed #556361
win32
msys2-mingw32

00:11:09

passed #556362
win32
vs2017-x64

00:07:48

failed #556355
fedora-x86_64

00:04:17

 
  Coverage
passed #556363
coverage

00:03:35

77.9%
 
  Analysis
passed #556365
scan-build

00:04:45

failed #556364
allowed to fail
valgrind

00:27:36

 
Name Stage Failure
failed
valgrind Analysis
Uploading artifacts...
_build/config.h: found 1 matching files
_build/glib/glibconfig.h: found 1 matching files

_build/meson-logs: found 7 matching files

Uploading artifacts to coordinator... ok
id=556364 responseStatus=201 Created token=JeBChZB9
Uploading artifacts...
_build/valgrind-report.xml: found 1 matching files

Uploading artifacts to coordinator... ok
id=556364 responseStatus=201 Created token=JeBChZB9
ERROR: Job failed: exit code 1