Fossil SCM
Reverted src/doc.c to the trunk version. The "Plan Z" reversion in [8264fd75] was incomplete, causing bad TH1 variable expansion. I believe this explains the symptom I worked around in [9bdf650f0b8]. This check-in also cherry-picks [3d6a4fd95c] onto the branch.
Commit
3cdf764c2c663581047515a950fc326d1fce7e075b8bdc8604c16162c0360a4b
Parent
74a6578cd4b1f18…
1 file changed
+10
-11
+10
-11
| --- src/doc.c | ||
| +++ src/doc.c | ||
| @@ -422,11 +422,11 @@ | ||
| 422 | 422 | while( fossil_isspace(zIn[0]) ) zIn++; |
| 423 | 423 | if( fossil_strnicmp(zIn,"<div",4)!=0 ) return 0; |
| 424 | 424 | zIn += 4; |
| 425 | 425 | while( zIn[0] ){ |
| 426 | 426 | if( fossil_isspace(zIn[0]) ) zIn++; |
| 427 | - if( zIn[0]=='>' ) return 0; | |
| 427 | + if( zIn[0]=='>' ) break; | |
| 428 | 428 | zAttr = zIn; |
| 429 | 429 | while( fossil_isalnum(zIn[0]) || zIn[0]=='-' ) zIn++; |
| 430 | 430 | nAttr = (int)(zIn - zAttr); |
| 431 | 431 | while( fossil_isspace(zIn[0]) ) zIn++; |
| 432 | 432 | if( zIn[0]!='=' ) continue; |
| @@ -514,29 +514,28 @@ | ||
| 514 | 514 | ** the following form is seen: |
| 515 | 515 | ** |
| 516 | 516 | ** href="$ROOT/ |
| 517 | 517 | ** action="$ROOT/ |
| 518 | 518 | ** |
| 519 | -** Convert $ROOT to the root URI of the repository. | |
| 520 | -** Allow ' in place of " | |
| 519 | +** Convert $ROOT to the root URI of the repository. Allow ' in place of " | |
| 520 | +** and any case for href or action. | |
| 521 | 521 | */ |
| 522 | 522 | void convert_href_and_output(Blob *pIn){ |
| 523 | 523 | int i, base; |
| 524 | 524 | int n = blob_size(pIn); |
| 525 | 525 | char *z = blob_buffer(pIn); |
| 526 | 526 | for(base=0, i=7; i<n; i++){ |
| 527 | 527 | if( z[i]=='$' |
| 528 | + && strncmp(&z[i],"$ROOT/", 6)==0 | |
| 528 | 529 | && (z[i-1]=='\'' || z[i-1]=='"') |
| 529 | - && i-base>=9 ) { | |
| 530 | + && i-base>=9 | |
| 531 | + && (fossil_strnicmp(&z[i-7]," href=", 6)==0 || | |
| 532 | + fossil_strnicmp(&z[i-9]," action=", 8)==0) | |
| 533 | + ){ | |
| 530 | 534 | blob_append(cgi_output_blob(), &z[base], i-base); |
| 531 | - if( strncmp(&z[i],"$ROOT/", 6)==0 | |
| 532 | - && (fossil_strnicmp(&z[i-7]," href=", 6)==0 || | |
| 533 | - fossil_strnicmp(&z[i-9]," action=", 8)==0) | |
| 534 | - ){ | |
| 535 | - blob_appendf(cgi_output_blob(), "%R"); | |
| 536 | - base = i+5; | |
| 537 | - } | |
| 535 | + blob_appendf(cgi_output_blob(), "%R"); | |
| 536 | + base = i+5; | |
| 538 | 537 | } |
| 539 | 538 | } |
| 540 | 539 | blob_append(cgi_output_blob(), &z[base], i-base); |
| 541 | 540 | } |
| 542 | 541 | |
| 543 | 542 |
| --- src/doc.c | |
| +++ src/doc.c | |
| @@ -422,11 +422,11 @@ | |
| 422 | while( fossil_isspace(zIn[0]) ) zIn++; |
| 423 | if( fossil_strnicmp(zIn,"<div",4)!=0 ) return 0; |
| 424 | zIn += 4; |
| 425 | while( zIn[0] ){ |
| 426 | if( fossil_isspace(zIn[0]) ) zIn++; |
| 427 | if( zIn[0]=='>' ) return 0; |
| 428 | zAttr = zIn; |
| 429 | while( fossil_isalnum(zIn[0]) || zIn[0]=='-' ) zIn++; |
| 430 | nAttr = (int)(zIn - zAttr); |
| 431 | while( fossil_isspace(zIn[0]) ) zIn++; |
| 432 | if( zIn[0]!='=' ) continue; |
| @@ -514,29 +514,28 @@ | |
| 514 | ** the following form is seen: |
| 515 | ** |
| 516 | ** href="$ROOT/ |
| 517 | ** action="$ROOT/ |
| 518 | ** |
| 519 | ** Convert $ROOT to the root URI of the repository. |
| 520 | ** Allow ' in place of " |
| 521 | */ |
| 522 | void convert_href_and_output(Blob *pIn){ |
| 523 | int i, base; |
| 524 | int n = blob_size(pIn); |
| 525 | char *z = blob_buffer(pIn); |
| 526 | for(base=0, i=7; i<n; i++){ |
| 527 | if( z[i]=='$' |
| 528 | && (z[i-1]=='\'' || z[i-1]=='"') |
| 529 | && i-base>=9 ) { |
| 530 | blob_append(cgi_output_blob(), &z[base], i-base); |
| 531 | if( strncmp(&z[i],"$ROOT/", 6)==0 |
| 532 | && (fossil_strnicmp(&z[i-7]," href=", 6)==0 || |
| 533 | fossil_strnicmp(&z[i-9]," action=", 8)==0) |
| 534 | ){ |
| 535 | blob_appendf(cgi_output_blob(), "%R"); |
| 536 | base = i+5; |
| 537 | } |
| 538 | } |
| 539 | } |
| 540 | blob_append(cgi_output_blob(), &z[base], i-base); |
| 541 | } |
| 542 | |
| 543 |
| --- src/doc.c | |
| +++ src/doc.c | |
| @@ -422,11 +422,11 @@ | |
| 422 | while( fossil_isspace(zIn[0]) ) zIn++; |
| 423 | if( fossil_strnicmp(zIn,"<div",4)!=0 ) return 0; |
| 424 | zIn += 4; |
| 425 | while( zIn[0] ){ |
| 426 | if( fossil_isspace(zIn[0]) ) zIn++; |
| 427 | if( zIn[0]=='>' ) break; |
| 428 | zAttr = zIn; |
| 429 | while( fossil_isalnum(zIn[0]) || zIn[0]=='-' ) zIn++; |
| 430 | nAttr = (int)(zIn - zAttr); |
| 431 | while( fossil_isspace(zIn[0]) ) zIn++; |
| 432 | if( zIn[0]!='=' ) continue; |
| @@ -514,29 +514,28 @@ | |
| 514 | ** the following form is seen: |
| 515 | ** |
| 516 | ** href="$ROOT/ |
| 517 | ** action="$ROOT/ |
| 518 | ** |
| 519 | ** Convert $ROOT to the root URI of the repository. Allow ' in place of " |
| 520 | ** and any case for href or action. |
| 521 | */ |
| 522 | void convert_href_and_output(Blob *pIn){ |
| 523 | int i, base; |
| 524 | int n = blob_size(pIn); |
| 525 | char *z = blob_buffer(pIn); |
| 526 | for(base=0, i=7; i<n; i++){ |
| 527 | if( z[i]=='$' |
| 528 | && strncmp(&z[i],"$ROOT/", 6)==0 |
| 529 | && (z[i-1]=='\'' || z[i-1]=='"') |
| 530 | && i-base>=9 |
| 531 | && (fossil_strnicmp(&z[i-7]," href=", 6)==0 || |
| 532 | fossil_strnicmp(&z[i-9]," action=", 8)==0) |
| 533 | ){ |
| 534 | blob_append(cgi_output_blob(), &z[base], i-base); |
| 535 | blob_appendf(cgi_output_blob(), "%R"); |
| 536 | base = i+5; |
| 537 | } |
| 538 | } |
| 539 | blob_append(cgi_output_blob(), &z[base], i-base); |
| 540 | } |
| 541 | |
| 542 |