Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 39531
b: refs/heads/master
c: 438dd92
h: refs/heads/master
i:
  39529: f93f74b
  39527: 1886cd2
v: v3
  • Loading branch information
Steve French committed Oct 11, 2006
1 parent 76cf908 commit c3e7658
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 268f3be177ce93791da38facc34126b5038cd851
refs/heads/master: 438dd926260f11ff01fc3441ac6dd4c412d20ea4
9 changes: 9 additions & 0 deletions trunk/fs/cifs/netmisc.c
Original file line number Diff line number Diff line change
Expand Up @@ -946,6 +946,15 @@ struct timespec cnvrtDosUnixTm(__u16 date, __u16 time)
year = sd->Year;
days += year * 365;
days += (year/4); /* leap year */
/* generalized leap year calculation is more complex, ie no leap year
for years/100 except for years/400, but since the maximum number for DOS
year is 2**7, the last year is 1980+127, which means we need only
consider 2 special case years, ie the years 2000 and 2100, and only
adjust for the lack of leap year for the year 2100, as 2000 was a
leap year (divisable by 400) */
if(year >= 120) /* the year 2100 */
days = days - 1; /* do not count leap year for the year 2100 */

/* adjust for leap year where we are still before leap day */
days -= ((year & 0x03) == 0) && (month < 2 ? 1 : 0);
sec += 24 * 60 * 60 * days;
Expand Down

0 comments on commit c3e7658

Please sign in to comment.