| | @@ -80,15 +80,15 @@ |
| 80 | 80 | for(i=0; zPath[i]; i=j){ |
| 81 | 81 | for(j=i; zPath[j] && zPath[j]!='/'; j++){} |
| 82 | 82 | if( zPath[j] && g.perm.Hyperlink ){ |
| 83 | 83 | if( zCI ){ |
| 84 | 84 | char *zLink = href("%R/dir?ci=%S&name=%#T", zCI, j, zPath); |
| 85 | | - blob_appendf(pOut, "%s%z%#h</a>", |
| 85 | + blob_appendf(pOut, "%s%z%#h</a>", |
| 86 | 86 | zSep, zLink, j-i, &zPath[i]); |
| 87 | 87 | }else{ |
| 88 | 88 | char *zLink = href("%R/dir?name=%#T", j, zPath); |
| 89 | | - blob_appendf(pOut, "%s%z%#h</a>", |
| 89 | + blob_appendf(pOut, "%s%z%#h</a>", |
| 90 | 90 | zSep, zLink, j-i, &zPath[i]); |
| 91 | 91 | } |
| 92 | 92 | }else{ |
| 93 | 93 | blob_appendf(pOut, "%s%#h", zSep, j-i, &zPath[i]); |
| 94 | 94 | } |
| | @@ -146,11 +146,11 @@ |
| 146 | 146 | }else{ |
| 147 | 147 | zCI = 0; |
| 148 | 148 | } |
| 149 | 149 | } |
| 150 | 150 | |
| 151 | | - /* Compute the title of the page */ |
| 151 | + /* Compute the title of the page */ |
| 152 | 152 | blob_zero(&dirname); |
| 153 | 153 | if( zD ){ |
| 154 | 154 | blob_append(&dirname, "in directory ", -1); |
| 155 | 155 | hyperlinked_path(zD, &dirname, zCI); |
| 156 | 156 | zPrefix = mprintf("%s/", zD); |
| | @@ -191,47 +191,39 @@ |
| 191 | 191 | @ %s(blob_str(&dirname))</h2> |
| 192 | 192 | zSubdirLink = mprintf("%R/dir?name=%T", zPrefix); |
| 193 | 193 | } |
| 194 | 194 | |
| 195 | 195 | /* Compute the temporary table "localfiles" containing the names |
| 196 | | - ** of all files and subdirectories in the zD[] directory. |
| 196 | + ** of all files and subdirectories in the zD[] directory. |
| 197 | 197 | ** |
| 198 | 198 | ** Subdirectory names begin with "/". This causes them to sort |
| 199 | 199 | ** first and it also gives us an easy way to distinguish files |
| 200 | 200 | ** from directories in the loop that follows. |
| 201 | 201 | */ |
| 202 | 202 | db_multi_exec( |
| 203 | | - "CREATE TEMP TABLE localfiles(x UNIQUE NOT NULL %s, u);", |
| 204 | | - filename_collation() |
| 203 | + "CREATE TEMP TABLE localfiles(x UNIQUE NOT NULL, u);" |
| 205 | 204 | ); |
| 206 | 205 | if( zCI ){ |
| 207 | 206 | Stmt ins; |
| 208 | 207 | ManifestFile *pFile; |
| 209 | 208 | ManifestFile *pPrev = 0; |
| 210 | 209 | int nPrev = 0; |
| 211 | 210 | int c; |
| 212 | | - int (*xCmp)(const char*,const char*,int); |
| 213 | | - |
| 214 | | - if( filenames_are_case_sensitive() ){ |
| 215 | | - xCmp = fossil_strncmp; |
| 216 | | - }else{ |
| 217 | | - xCmp = fossil_strnicmp; |
| 218 | | - } |
| 219 | 211 | |
| 220 | 212 | db_prepare(&ins, |
| 221 | 213 | "INSERT OR IGNORE INTO localfiles VALUES(pathelement(:x,0), :u)" |
| 222 | 214 | ); |
| 223 | 215 | manifest_file_rewind(pM); |
| 224 | 216 | while( (pFile = manifest_file_next(pM,0))!=0 ){ |
| 225 | | - if( nD>0 |
| 226 | | - && (xCmp(pFile->zName, zD, nD-1)!=0 |
| 217 | + if( nD>0 |
| 218 | + && (fossil_strncmp(pFile->zName, zD, nD-1)!=0 |
| 227 | 219 | || pFile->zName[nD-1]!='/') |
| 228 | 220 | ){ |
| 229 | 221 | continue; |
| 230 | 222 | } |
| 231 | 223 | if( pPrev |
| 232 | | - && xCmp(&pFile->zName[nD],&pPrev->zName[nD],nPrev)==0 |
| 224 | + && fossil_strncmp(&pFile->zName[nD],&pPrev->zName[nD],nPrev)==0 |
| 233 | 225 | && (pFile->zName[nD+nPrev]==0 || pFile->zName[nD+nPrev]=='/') |
| 234 | 226 | ){ |
| 235 | 227 | continue; |
| 236 | 228 | } |
| 237 | 229 | db_bind_text(&ins, ":x", &pFile->zName[nD]); |
| | @@ -242,25 +234,16 @@ |
| 242 | 234 | for(nPrev=0; (c=pPrev->zName[nD+nPrev]) && c!='/'; nPrev++){} |
| 243 | 235 | if( c=='/' ) nPrev++; |
| 244 | 236 | } |
| 245 | 237 | db_finalize(&ins); |
| 246 | 238 | }else if( zD ){ |
| 247 | | - if( filenames_are_case_sensitive() ){ |
| 248 | | - db_multi_exec( |
| 249 | | - "INSERT OR IGNORE INTO localfiles" |
| 250 | | - " SELECT pathelement(name,%d), NULL FROM filename" |
| 251 | | - " WHERE name GLOB '%q/*'", |
| 252 | | - nD, zD |
| 253 | | - ); |
| 254 | | - }else{ |
| 255 | | - db_multi_exec( |
| 256 | | - "INSERT OR IGNORE INTO localfiles" |
| 257 | | - " SELECT pathelement(name,%d), NULL FROM filename" |
| 258 | | - " WHERE name LIKE '%q/%%'", |
| 259 | | - nD, zD |
| 260 | | - ); |
| 261 | | - } |
| 239 | + db_multi_exec( |
| 240 | + "INSERT OR IGNORE INTO localfiles" |
| 241 | + " SELECT pathelement(name,%d), NULL FROM filename" |
| 242 | + " WHERE name GLOB '%q/*'", |
| 243 | + nD, zD |
| 244 | + ); |
| 262 | 245 | }else{ |
| 263 | 246 | db_multi_exec( |
| 264 | 247 | "INSERT OR IGNORE INTO localfiles" |
| 265 | 248 | " SELECT pathelement(name,0), NULL FROM filename" |
| 266 | 249 | ); |
| | @@ -351,11 +334,11 @@ |
| 351 | 334 | "CREATE INDEX fileage_fid ON fileage(fid);" |
| 352 | 335 | ); |
| 353 | 336 | pManifest = manifest_get(vid, CFTYPE_MANIFEST); |
| 354 | 337 | if( pManifest==0 ) return 1; |
| 355 | 338 | manifest_file_rewind(pManifest); |
| 356 | | - db_prepare(&ins, |
| 339 | + db_prepare(&ins, |
| 357 | 340 | "INSERT INTO temp.fileage(fid, pathname)" |
| 358 | 341 | " SELECT rid, :path FROM blob WHERE uuid=:uuid" |
| 359 | 342 | ); |
| 360 | 343 | while( (pFile = manifest_file_next(pManifest, 0))!=0 ){ |
| 361 | 344 | db_bind_text(&ins, ":uuid", pFile->zUuid); |
| | @@ -428,13 +411,13 @@ |
| 428 | 411 | baseTime = db_double(0.0, "SELECT mtime FROM event WHERE objid=%d", rid); |
| 429 | 412 | zBaseTime = db_text("","SELECT datetime(%.20g,'localtime')", baseTime); |
| 430 | 413 | @ <h2>File Ages For Check-in |
| 431 | 414 | @ %z(href("%R/info?name=%T",zName))%h(zName)</a></h2> |
| 432 | 415 | @ |
| 433 | | - @ <p>The times given are relative |
| 416 | + @ <p>The times given are relative |
| 434 | 417 | @ %z(href("%R/timeline?c=%T",zBaseTime))%s(zBaseTime)</a>, which is the |
| 435 | | - @ check-in time for |
| 418 | + @ check-in time for |
| 436 | 419 | @ %z(href("%R/info?name=%T",zName))%h(zName)</a></p> |
| 437 | 420 | @ |
| 438 | 421 | @ <table border=0 cellspacing=0 cellpadding=0> |
| 439 | 422 | db_prepare(&q, |
| 440 | 423 | "SELECT mtime, (SELECT uuid FROM blob WHERE rid=fid), mid, pathname" |
| | @@ -471,7 +454,7 @@ |
| 471 | 454 | @ |
| 472 | 455 | } |
| 473 | 456 | @ <tr><td colspan=3><hr></tr> |
| 474 | 457 | @ </table> |
| 475 | 458 | db_finalize(&q); |
| 476 | | - style_footer(); |
| 459 | + style_footer(); |
| 477 | 460 | } |
| 478 | 461 | |