Skip to content

Commit f2b6c8b

Browse files
committed
Merge branch 'bug/80'
* bug/80: fix, use dt_io_clear_zones() in all tools, fixes issue #80 test, provide regression case for issue #80
2 parents 0851758 + d0ce659 commit f2b6c8b

File tree

4 files changed

+16
-6
lines changed

4 files changed

+16
-6
lines changed

src/dtest.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -142,9 +142,7 @@ main(int argc, char *argv[])
142142
res = res == 1 || res == 0 ? 0 : 1;
143143
}
144144
out:
145-
if (fromz != NULL) {
146-
zif_close(fromz);
147-
}
145+
dt_io_clear_zones();
148146
if (argi->from_locale_arg) {
149147
setilocale(NULL);
150148
}

src/dzone.c

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -362,9 +362,6 @@ nor a date/time corresponding to the given input formats", inp);
362362
free(d);
363363
}
364364

365-
if (fromz != NULL) {
366-
zif_close(fromz);
367-
}
368365
if (argi->from_locale_arg) {
369366
setilocale(NULL);
370367
}

test/Makefile.am

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -864,6 +864,7 @@ dt_tests += dzone.010.clit
864864
dt_tests += dzone.011.clit
865865
dt_tests += dzone.012.clit
866866
dt_tests += dzone.013.clit
867+
dt_tests += dzone.014.clit
867868

868869
dt_tests += dsort.001.clit
869870
dt_tests += dsort.002.clit

test/dzone.014.clit

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
#!/usr/bin/clitoris ## -*- shell-script -*-
2+
3+
## this is issue #80
4+
$ dzone --input-format='%m/%d/%Y,%H:%M' --from-zone='America/New_York' UTC '03/14/2017,11:30'
5+
2017-03-14T15:30:00+00:00 UTC
6+
$ dzone --input-format='%m/%d/%Y,%H:%M' --from-zone='America/New_York' '03/14/2017,11:30'
7+
2017-03-14T15:30:00-04:00
8+
$ dzone --input-format='%m/%d/%Y,%H:%M' UTC '03/14/2017,11:30'
9+
2017-03-14T11:30:00+00:00 UTC
10+
$ dzone --input-format='%m/%d/%Y,%H:%M' '03/14/2017,11:30'
11+
2017-03-14T11:30:00+00:00
12+
$
13+
14+
## dzone.014.clit ends here

0 commit comments

Comments
 (0)