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.

wyoung 2019-08-20 06:28 server-docs
Commit 3cdf764c2c663581047515a950fc326d1fce7e075b8bdc8604c16162c0360a4b
1 file changed +10 -11
+10 -11
--- src/doc.c
+++ src/doc.c
@@ -422,11 +422,11 @@
422422
while( fossil_isspace(zIn[0]) ) zIn++;
423423
if( fossil_strnicmp(zIn,"<div",4)!=0 ) return 0;
424424
zIn += 4;
425425
while( zIn[0] ){
426426
if( fossil_isspace(zIn[0]) ) zIn++;
427
- if( zIn[0]=='>' ) return 0;
427
+ if( zIn[0]=='>' ) break;
428428
zAttr = zIn;
429429
while( fossil_isalnum(zIn[0]) || zIn[0]=='-' ) zIn++;
430430
nAttr = (int)(zIn - zAttr);
431431
while( fossil_isspace(zIn[0]) ) zIn++;
432432
if( zIn[0]!='=' ) continue;
@@ -514,29 +514,28 @@
514514
** the following form is seen:
515515
**
516516
** href="$ROOT/
517517
** action="$ROOT/
518518
**
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.
521521
*/
522522
void convert_href_and_output(Blob *pIn){
523523
int i, base;
524524
int n = blob_size(pIn);
525525
char *z = blob_buffer(pIn);
526526
for(base=0, i=7; i<n; i++){
527527
if( z[i]=='$'
528
+ && strncmp(&z[i],"$ROOT/", 6)==0
528529
&& (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
+ ){
530534
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;
538537
}
539538
}
540539
blob_append(cgi_output_blob(), &z[base], i-base);
541540
}
542541
543542
--- 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

Keyboard Shortcuts

Open search /
Next entry (timeline) j
Previous entry (timeline) k
Open focused entry Enter
Show this help ?
Toggle theme Top nav button