Fossil SCM
Remove a faulty assert() statement inserted by check-in [9c1199d723e0acda].
Commit
537a1394d8cfd3429e93ca85965ab90b268bae28aaa3e34158c10aee9f2cc071
Parent
9ce4dd0db25b758…
1 file changed
+7
-5
+7
-5
| --- src/repolist.c | ||
| +++ src/repolist.c | ||
| @@ -174,11 +174,11 @@ | ||
| 174 | 174 | int nName = (int)strlen(zName); |
| 175 | 175 | char *zUrl; |
| 176 | 176 | char *zAge; |
| 177 | 177 | char *zFull; |
| 178 | 178 | RepoInfo x; |
| 179 | - int iAge; | |
| 179 | + sqlite3_int64 iAge; | |
| 180 | 180 | if( nName<7 ) continue; |
| 181 | 181 | zUrl = sqlite3_mprintf("%.*s", nName-7, zName); |
| 182 | 182 | if( zName[0]=='/' |
| 183 | 183 | #ifdef _WIN32 |
| 184 | 184 | || sqlite3_strglob("[a-zA-Z]:/*", zName)==0 |
| @@ -205,14 +205,16 @@ | ||
| 205 | 205 | if( x.isRepolistSkin==2 && !allRepo ){ |
| 206 | 206 | /* Repositories with repolist-skin==2 are omitted from directory |
| 207 | 207 | ** scan lists, but included in "fossil all ui" lists */ |
| 208 | 208 | continue; |
| 209 | 209 | } |
| 210 | - /* Assert that the following cast will not narrow in fact. */ | |
| 211 | - assert((rNow - x.rMTime)<=(((unsigned)~0)>>1)/86400.0); | |
| 212 | - iAge = (int)((rNow - x.rMTime)*86400); | |
| 213 | - if( iAge<0 ) x.rMTime = rNow; | |
| 210 | + if( rNow <= x.rMTime ){ | |
| 211 | + x.rMTime = rNow; | |
| 212 | + }else if( x.rMTime<0.0 ){ | |
| 213 | + x.rMTime = rNow; | |
| 214 | + } | |
| 215 | + iAge = (int)(rNow - x.rMTime)*86400; | |
| 214 | 216 | zAge = human_readable_age(rNow - x.rMTime); |
| 215 | 217 | blob_append_sql(&html, "<tr><td valign='top'>"); |
| 216 | 218 | if( sqlite3_strglob("*.fossil", zName)!=0 ){ |
| 217 | 219 | /* The "fossil server DIRECTORY" and "fossil ui DIRECTORY" commands |
| 218 | 220 | ** do not work for repositories whose names do not end in ".fossil". |
| 219 | 221 |
| --- src/repolist.c | |
| +++ src/repolist.c | |
| @@ -174,11 +174,11 @@ | |
| 174 | int nName = (int)strlen(zName); |
| 175 | char *zUrl; |
| 176 | char *zAge; |
| 177 | char *zFull; |
| 178 | RepoInfo x; |
| 179 | int iAge; |
| 180 | if( nName<7 ) continue; |
| 181 | zUrl = sqlite3_mprintf("%.*s", nName-7, zName); |
| 182 | if( zName[0]=='/' |
| 183 | #ifdef _WIN32 |
| 184 | || sqlite3_strglob("[a-zA-Z]:/*", zName)==0 |
| @@ -205,14 +205,16 @@ | |
| 205 | if( x.isRepolistSkin==2 && !allRepo ){ |
| 206 | /* Repositories with repolist-skin==2 are omitted from directory |
| 207 | ** scan lists, but included in "fossil all ui" lists */ |
| 208 | continue; |
| 209 | } |
| 210 | /* Assert that the following cast will not narrow in fact. */ |
| 211 | assert((rNow - x.rMTime)<=(((unsigned)~0)>>1)/86400.0); |
| 212 | iAge = (int)((rNow - x.rMTime)*86400); |
| 213 | if( iAge<0 ) x.rMTime = rNow; |
| 214 | zAge = human_readable_age(rNow - x.rMTime); |
| 215 | blob_append_sql(&html, "<tr><td valign='top'>"); |
| 216 | if( sqlite3_strglob("*.fossil", zName)!=0 ){ |
| 217 | /* The "fossil server DIRECTORY" and "fossil ui DIRECTORY" commands |
| 218 | ** do not work for repositories whose names do not end in ".fossil". |
| 219 |
| --- src/repolist.c | |
| +++ src/repolist.c | |
| @@ -174,11 +174,11 @@ | |
| 174 | int nName = (int)strlen(zName); |
| 175 | char *zUrl; |
| 176 | char *zAge; |
| 177 | char *zFull; |
| 178 | RepoInfo x; |
| 179 | sqlite3_int64 iAge; |
| 180 | if( nName<7 ) continue; |
| 181 | zUrl = sqlite3_mprintf("%.*s", nName-7, zName); |
| 182 | if( zName[0]=='/' |
| 183 | #ifdef _WIN32 |
| 184 | || sqlite3_strglob("[a-zA-Z]:/*", zName)==0 |
| @@ -205,14 +205,16 @@ | |
| 205 | if( x.isRepolistSkin==2 && !allRepo ){ |
| 206 | /* Repositories with repolist-skin==2 are omitted from directory |
| 207 | ** scan lists, but included in "fossil all ui" lists */ |
| 208 | continue; |
| 209 | } |
| 210 | if( rNow <= x.rMTime ){ |
| 211 | x.rMTime = rNow; |
| 212 | }else if( x.rMTime<0.0 ){ |
| 213 | x.rMTime = rNow; |
| 214 | } |
| 215 | iAge = (int)(rNow - x.rMTime)*86400; |
| 216 | zAge = human_readable_age(rNow - x.rMTime); |
| 217 | blob_append_sql(&html, "<tr><td valign='top'>"); |
| 218 | if( sqlite3_strglob("*.fossil", zName)!=0 ){ |
| 219 | /* The "fossil server DIRECTORY" and "fossil ui DIRECTORY" commands |
| 220 | ** do not work for repositories whose names do not end in ".fossil". |
| 221 |