Handle dates past January 19th, 2038

Try to support dates past year 2038 on systems with 64-bit time_t.

Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
This commit is contained in:
Lukas Fleischer
2015-01-19 23:47:55 +01:00
parent 4fd8f0b11e
commit a12833ec08
5 changed files with 36 additions and 13 deletions

4
test/data/apts-y2k38-001 Normal file
View File

@@ -0,0 +1,4 @@
01/19/2038 [1] Event 1
01/20/2038 [1] Event 2
01/01/2100 [1] Event 3
01/01/9999 [1] Event 4

27
test/y2k38-001.sh Executable file
View File

@@ -0,0 +1,27 @@
#!/bin/sh
. "${TEST_INIT:-./test-init.sh}"
if [ "$1" = 'actual' ]; then
"$CALCURSE" --read-only -D "$DATA_DIR"/ -c "$DATA_DIR/apts-y2k38-001" \
-d01/19/2038
"$CALCURSE" --read-only -D "$DATA_DIR"/ -c "$DATA_DIR/apts-y2k38-001" \
-d01/20/2038
"$CALCURSE" --read-only -D "$DATA_DIR"/ -c "$DATA_DIR/apts-y2k38-001" \
-d01/01/2100
"$CALCURSE" --read-only -D "$DATA_DIR"/ -c "$DATA_DIR/apts-y2k38-001" \
-d01/01/9999
elif [ "$1" = 'expected' ]; then
cat <<EOD
01/19/38:
* Event 1
01/20/38:
* Event 2
01/01/00:
* Event 3
01/01/99:
* Event 4
EOD
else
./run-test "$0"
fi