]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
test-calendarspec: do not convert timezone "" to ":"
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Mon, 22 Mar 2021 10:29:35 +0000 (11:29 +0100)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Mon, 22 Mar 2021 19:08:16 +0000 (20:08 +0100)
I *think* it doesn't actually make any difference, because ":" will be ignored.
437f48a471f51ac9dd2697ee3b848a71b4f101df added prefixing with ":", but didn't
take into account the fact that we also use "" with a different meaning than
NULL here. But let's restore the original behaviour of specifying the empty
string.

src/test/test-calendarspec.c

index 152ce879f8ac97c102a1d94a90096e9f29fd52c3..c62e6860cf98efd1dd37042331b8a046fa681077 100644 (file)
@@ -44,7 +44,7 @@ static void _test_next(int line, const char *input, const char *new_tz, usec_t a
         if (old_tz)
                 old_tz = strdupa(old_tz);
 
-        if (new_tz)
+        if (!isempty(new_tz))
                 new_tz = strjoina(":", new_tz);
 
         assert_se(set_unset_env("TZ", new_tz, true) == 0);