Many hyperlinks are disabled.
Use anonymous login
to enable hyperlinks.
Overview
| Comment: | For the /doc web method, append "index.html" if the path ends with "/". |
|---|---|
| Downloads: | Tarball | ZIP archive |
| Timelines: | family | ancestors | descendants | both | trunk |
| Files: | files | file ages | folders |
| SHA1: |
49a015ef79c62105d84dd540090b1905 |
| User & Date: | drh 2011-10-29 17:22:31.938 |
Context
|
2011-10-29
| ||
| 19:29 | Update the built-in SQLite to the 3.7.9 release candidate. ... (check-in: 326979358d user: drh tags: trunk) | |
| 17:22 | For the /doc web method, append "index.html" if the path ends with "/". ... (check-in: 49a015ef79 user: drh tags: trunk) | |
|
2011-10-28
| ||
| 20:40 | Remove an unnecessary SQL operation that sometimes causes errors. ... (check-in: 5da9a8c824 user: drh tags: trunk) | |
Changes
Changes to src/doc.c.
| ︙ | ︙ | |||
365 366 367 368 369 370 371 372 373 374 375 376 377 378 |
char zBaseline[UUID_SIZE+1]; /* Baseline UUID */
login_check_credentials();
if( !g.perm.Read ){ login_needed(); return; }
zName = PD("name", "tip/index.wiki");
for(i=0; zName[i] && zName[i]!='/'; i++){}
if( zName[i]==0 || i>UUID_SIZE ){
goto doc_not_found;
}
memcpy(zBaseline, zName, i);
zBaseline[i] = 0;
zName += i;
while( zName[0]=='/' ){ zName++; }
if( !file_is_simple_pathname(zName) ){
| > > > > > | > > > > | 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 |
char zBaseline[UUID_SIZE+1]; /* Baseline UUID */
login_check_credentials();
if( !g.perm.Read ){ login_needed(); return; }
zName = PD("name", "tip/index.wiki");
for(i=0; zName[i] && zName[i]!='/'; i++){}
if( zName[i]==0 || i>UUID_SIZE ){
zName = "index.html";
goto doc_not_found;
}
memcpy(zBaseline, zName, i);
zBaseline[i] = 0;
zName += i;
while( zName[0]=='/' ){ zName++; }
if( !file_is_simple_pathname(zName) ){
int n = strlen(zName);
if( n>0 && zName[n-1]=='/' ){
zName = mprintf("%sindex.html", zName);
if( !file_is_simple_pathname(zName) ){
goto doc_not_found;
}
}else{
goto doc_not_found;
}
}
if( fossil_strcmp(zBaseline,"ckout")==0 && db_open_local()==0 ){
sqlite3_snprintf(sizeof(zBaseline), zBaseline, "tip");
}
if( fossil_strcmp(zBaseline,"ckout")==0 ){
/* Read from the local checkout */
char *zFullpath;
|
| ︙ | ︙ | |||
406 407 408 409 410 411 412 413 414 415 416 417 418 419 |
"CREATE TABLE IF NOT EXISTS vcache(\n"
" vid INTEGER, -- baseline ID\n"
" fname TEXT, -- filename\n"
" rid INTEGER, -- artifact ID\n"
" UNIQUE(vid,fname,rid)\n"
")"
);
/* Check to see if the documentation file artifact ID is contained
** in the baseline cache */
rid = db_int(0, "SELECT rid FROM vcache"
" WHERE vid=%d AND fname=%Q", vid, zName);
if( rid==0 && db_exists("SELECT 1 FROM vcache WHERE vid=%d", vid) ){
goto doc_not_found;
| > > | 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 |
"CREATE TABLE IF NOT EXISTS vcache(\n"
" vid INTEGER, -- baseline ID\n"
" fname TEXT, -- filename\n"
" rid INTEGER, -- artifact ID\n"
" UNIQUE(vid,fname,rid)\n"
")"
);
/* Check to see if the documentation file artifact ID is contained
** in the baseline cache */
rid = db_int(0, "SELECT rid FROM vcache"
" WHERE vid=%d AND fname=%Q", vid, zName);
if( rid==0 && db_exists("SELECT 1 FROM vcache WHERE vid=%d", vid) ){
goto doc_not_found;
|
| ︙ | ︙ | |||
497 498 499 500 501 502 503 |
}
return;
doc_not_found:
/* Jump here when unable to locate the document */
db_end_transaction(0);
style_header("Document Not Found");
| | | 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 |
}
return;
doc_not_found:
/* Jump here when unable to locate the document */
db_end_transaction(0);
style_header("Document Not Found");
@ <p>No such document: %h(zName)</p>
style_footer();
return;
}
/*
** The default logo.
*/
|
| ︙ | ︙ |