Unified · Split
| @@ -9,6 +9,8 @@ · 8 unmodified lines | |||
| 9 | #include "fns.h" | 9 | #include "fns.h" |
| 10 | #include "error.h" | 10 | #include "error.h" |
| 11 | 11 | ||
| 12 | #include <libsec.h> /* for sha1 in pathhash() */ | ||
| 13 | |||
| 12 | typedef struct DIR DIR; | 14 | typedef struct DIR DIR; |
| 13 | typedef struct Ufsinfo Ufsinfo; | 15 | typedef struct Ufsinfo Ufsinfo; |
| 14 | 16 | ||
| @@ -65,11 +67,11 @@ unixtime(FILETIME *ft) · 50 unmodified lines | |||
| 65 | static uvlong | 67 | static uvlong |
| 66 | pathhash(TCHAR *p) | 68 | pathhash(TCHAR *p) |
| 67 | { | 69 | { |
| 68 | uvlong h; | 70 | uchar digest[SHA1dlen]; |
| 69 | h = 0LL; | 71 | int n; |
| 70 | for(; *p; p++) | 72 | for(n=0; p[n] != 0; n++); |
| 71 | h += *p * 13; | 73 | sha1((uchar*)p, n*sizeof(TCHAR), digest, nil); |
| 72 | return h; | 74 | return *(uvlong*)digest; |
| 73 | } | 75 | } |
| 74 | 76 | ||
| 75 | static ulong | 77 | static ulong |