]>
Commit | Line | Data |
---|---|---|
a6d1728f AM |
1 | --- src/vers_ts.c~ Sun Oct 4 02:01:40 1998 |
2 | +++ src/vers_ts.c Mon Jan 8 12:00:57 2001 | |
3 | @@ -340,13 +340,22 @@ | |
4 | { | |
5 | struct stat sb; | |
6 | char *cp; | |
7 | - char *ts; | |
8 | + char *ts = NULL; | |
9 | + time_t mtime = 0L; | |
10 | ||
11 | - if (CVS_LSTAT (file, &sb) < 0) | |
12 | + if (!CVS_LSTAT (file, &sb)) | |
13 | { | |
14 | - ts = NULL; | |
15 | + mtime = sb.st_mtime; | |
16 | } | |
17 | - else | |
18 | + /* If it's a symlink, return whichever is the newest mtime of | |
19 | + the link and its target, for safety. | |
20 | + */ | |
21 | + if (!CVS_STAT (file, &sb)) | |
22 | + { | |
23 | + if (mtime < sb.st_mtime) | |
24 | + mtime = sb.st_mtime; | |
25 | + } | |
26 | + if (mtime) | |
27 | { | |
28 | struct tm *tm_p; | |
29 | struct tm local_tm; |