Skip to content

Commit ee648b9

Browse files
author
Philipp Moeller
committed
Merge pull request #5 from dandart/master
Let 1 be 1
2 parents 0091c1c + c045cd7 commit ee648b9

File tree

3 files changed

+13
-2
lines changed

3 files changed

+13
-2
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
build

ddate.1

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,8 @@ Original program by Druel the Chaotic aka Jeremy Johnson (mpython@gnu.ai.mit.edu
9494
.br
9595
Major rewrite by Lee H:. O:. Smith, KYTP, aka Andrew Bulhak (acb@dev.null.org)
9696
.br
97+
Gregorian B.C.E. dates fixed by Chaplain Nyan the Wiser, aka Dan Dart (ntw@dandart.co.uk)
98+
.br
9799
Five tons of flax.
98100

99101
.SH DISTRIBUTION POLICY

ddate.c

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,13 +18,18 @@
1818
Sweetmorn, Bureaucracy 42, 3161 YOLD, by Lee H:. O:. Smith, KYTP,
1919
aka Andrew Bulhak, aka acb@dev.null.org
2020
21+
Slightly hackled and crackled by a sweet firey stove on
22+
Boomtime, the 53rd day of Bureaucracy in the YOLD 3179,
23+
by Chaplain Nyan the Wiser, aka Dan Dart, aka ntw@dandart.co.uk
24+
2125
and I'm not responsible if this program messes anything up (except your
2226
mind, I'm responsible for that) (and that goes for me as well --lhos)
2327
2428
Version history:
2529
Bureflux 3161: First release of enhanced ddate with format strings
2630
59 Bcy, 3161: PRAISE_BOB and KILL_BOB options split, other minor
2731
changes.
32+
53 Bcy, 3179: Fixed gregorian date conversions less than YOLD 1167
2833
2934
1999-02-22 Arkadiusz Miskiewicz <misiek@pld.ORG.PL>
3035
- added Native Language Support
@@ -136,6 +141,7 @@ char *excl[] = {
136141
"Grudnuk demand sustenance!", "Keep the Lasagna flying!",
137142
"You are what you see.",
138143
"Or is it?", "This statement is false.",
144+
"Lies and slander, sire!", "Hee hee hee!",
139145
#if defined(linux) || defined (__linux__) || defined (__linux)
140146
"Hail Eris, Hack Linux!",
141147
#elif defined(__APPLE__)
@@ -324,7 +330,7 @@ struct disc_time makeday(int imonth,int iday,int iyear) /*i for input */
324330

325331
memset(&funkychickens,0,sizeof(funkychickens));
326332
/* basic range checks */
327-
if (imonth < 1 || imonth > 12) {
333+
if (imonth < 1 || imonth > 12 || iyear == 0) {
328334
funkychickens.season = -1;
329335
return funkychickens;
330336
}
@@ -337,7 +343,9 @@ struct disc_time makeday(int imonth,int iday,int iyear) /*i for input */
337343
}
338344

339345
imonth--;
340-
funkychickens.year= iyear+1166;
346+
/* note: gregorian year 0 doesn't exist so
347+
* add one if user specifies a year less than 0 */
348+
funkychickens.year= iyear+1166 + ((0 > iyear)?1:0);
341349
while(imonth>0) { dayspast+=cal[--imonth]; }
342350
funkychickens.day=dayspast+iday-1;
343351
funkychickens.season=0;

0 commit comments

Comments
 (0)