Fossil SCM
Fix incorrect insertion of </ul> tags.
Commit
417d18082bde5bdda79b65484f61314986ef0f60
Parent
377a4f2d534f733…
1 file changed
+7
-9
+7
-9
| --- src/browse.c | ||
| +++ src/browse.c | ||
| @@ -413,11 +413,10 @@ | ||
| 413 | 413 | char *zREx = ""; /* Extra parameters for path hyperlinks */ |
| 414 | 414 | ReCompiled *pRE = 0; /* Compiled regular expression */ |
| 415 | 415 | FileTreeNode *p; /* One line of the tree */ |
| 416 | 416 | FileTree sTree; /* The complete tree of files */ |
| 417 | 417 | HQuery sURI; /* Hyperlink */ |
| 418 | - int iDepth = 0; /* <ul> depth */ | |
| 419 | 418 | char *zProjectName = db_get("project-name", 0); |
| 420 | 419 | |
| 421 | 420 | if( strcmp(PD("type",""),"flat")==0 ){ page_dir(); return; } |
| 422 | 421 | memset(&sTree, 0, sizeof(sTree)); |
| 423 | 422 | login_check_credentials(); |
| @@ -554,11 +553,10 @@ | ||
| 554 | 553 | @ %z(zLink)%h(zProjectName)</a> |
| 555 | 554 | }else{ |
| 556 | 555 | @ <a>%h(zProjectName)</a> |
| 557 | 556 | } |
| 558 | 557 | @ <ul class="filetree"> |
| 559 | - iDepth = 2; | |
| 560 | 558 | for(p=sTree.pFirst; p; p=p->pNext){ |
| 561 | 559 | if( p->isDir ){ |
| 562 | 560 | @ <li class="dir"> |
| 563 | 561 | if( fossil_strcmp(p->zFullName, zD)==0 ){ |
| 564 | 562 | @ <a>%h(p->zName)</a> |
| @@ -565,28 +563,28 @@ | ||
| 565 | 563 | }else{ |
| 566 | 564 | char *zLink = href("%s", url_render(&sURI, "name", p->zFullName, 0, 0)); |
| 567 | 565 | @ %z(zLink)%h(p->zName)</a> |
| 568 | 566 | } |
| 569 | 567 | @ <ul class="filetree"> |
| 570 | - iDepth++; | |
| 571 | 568 | }else{ |
| 572 | 569 | char *zLink; |
| 573 | 570 | if( zCI ){ |
| 574 | 571 | zLink = href("%R/artifact/%s",p->zUuid); |
| 575 | 572 | }else{ |
| 576 | 573 | zLink = href("%R/finfo?name=%T",p->zFullName); |
| 577 | 574 | } |
| 578 | 575 | @ <li class="file">%z(zLink)%h(p->zName)</a> |
| 579 | 576 | } |
| 580 | - if( p->isLast && !p->isDir ){ | |
| 581 | - @ </ul> | |
| 582 | - iDepth--; | |
| 577 | + if( p->isLast ){ | |
| 578 | + int nClose = p->iLevel - (p->pNext ? p->pNext->iLevel : 0); | |
| 579 | + while( nClose-- > 0 ){ | |
| 580 | + @ </ul> | |
| 581 | + } | |
| 583 | 582 | } |
| 584 | 583 | } |
| 585 | - while( iDepth-- > 0 ) { | |
| 586 | - @ </ul> | |
| 587 | - } | |
| 584 | + @ </ul> | |
| 585 | + @ </ul> | |
| 588 | 586 | style_footer(); |
| 589 | 587 | |
| 590 | 588 | /* We could free memory used by sTree here if we needed to. But |
| 591 | 589 | ** the process is about to exit, so doing so would not really accomplish |
| 592 | 590 | ** anything useful. */ |
| 593 | 591 |
| --- src/browse.c | |
| +++ src/browse.c | |
| @@ -413,11 +413,10 @@ | |
| 413 | char *zREx = ""; /* Extra parameters for path hyperlinks */ |
| 414 | ReCompiled *pRE = 0; /* Compiled regular expression */ |
| 415 | FileTreeNode *p; /* One line of the tree */ |
| 416 | FileTree sTree; /* The complete tree of files */ |
| 417 | HQuery sURI; /* Hyperlink */ |
| 418 | int iDepth = 0; /* <ul> depth */ |
| 419 | char *zProjectName = db_get("project-name", 0); |
| 420 | |
| 421 | if( strcmp(PD("type",""),"flat")==0 ){ page_dir(); return; } |
| 422 | memset(&sTree, 0, sizeof(sTree)); |
| 423 | login_check_credentials(); |
| @@ -554,11 +553,10 @@ | |
| 554 | @ %z(zLink)%h(zProjectName)</a> |
| 555 | }else{ |
| 556 | @ <a>%h(zProjectName)</a> |
| 557 | } |
| 558 | @ <ul class="filetree"> |
| 559 | iDepth = 2; |
| 560 | for(p=sTree.pFirst; p; p=p->pNext){ |
| 561 | if( p->isDir ){ |
| 562 | @ <li class="dir"> |
| 563 | if( fossil_strcmp(p->zFullName, zD)==0 ){ |
| 564 | @ <a>%h(p->zName)</a> |
| @@ -565,28 +563,28 @@ | |
| 565 | }else{ |
| 566 | char *zLink = href("%s", url_render(&sURI, "name", p->zFullName, 0, 0)); |
| 567 | @ %z(zLink)%h(p->zName)</a> |
| 568 | } |
| 569 | @ <ul class="filetree"> |
| 570 | iDepth++; |
| 571 | }else{ |
| 572 | char *zLink; |
| 573 | if( zCI ){ |
| 574 | zLink = href("%R/artifact/%s",p->zUuid); |
| 575 | }else{ |
| 576 | zLink = href("%R/finfo?name=%T",p->zFullName); |
| 577 | } |
| 578 | @ <li class="file">%z(zLink)%h(p->zName)</a> |
| 579 | } |
| 580 | if( p->isLast && !p->isDir ){ |
| 581 | @ </ul> |
| 582 | iDepth--; |
| 583 | } |
| 584 | } |
| 585 | while( iDepth-- > 0 ) { |
| 586 | @ </ul> |
| 587 | } |
| 588 | style_footer(); |
| 589 | |
| 590 | /* We could free memory used by sTree here if we needed to. But |
| 591 | ** the process is about to exit, so doing so would not really accomplish |
| 592 | ** anything useful. */ |
| 593 |
| --- src/browse.c | |
| +++ src/browse.c | |
| @@ -413,11 +413,10 @@ | |
| 413 | char *zREx = ""; /* Extra parameters for path hyperlinks */ |
| 414 | ReCompiled *pRE = 0; /* Compiled regular expression */ |
| 415 | FileTreeNode *p; /* One line of the tree */ |
| 416 | FileTree sTree; /* The complete tree of files */ |
| 417 | HQuery sURI; /* Hyperlink */ |
| 418 | char *zProjectName = db_get("project-name", 0); |
| 419 | |
| 420 | if( strcmp(PD("type",""),"flat")==0 ){ page_dir(); return; } |
| 421 | memset(&sTree, 0, sizeof(sTree)); |
| 422 | login_check_credentials(); |
| @@ -554,11 +553,10 @@ | |
| 553 | @ %z(zLink)%h(zProjectName)</a> |
| 554 | }else{ |
| 555 | @ <a>%h(zProjectName)</a> |
| 556 | } |
| 557 | @ <ul class="filetree"> |
| 558 | for(p=sTree.pFirst; p; p=p->pNext){ |
| 559 | if( p->isDir ){ |
| 560 | @ <li class="dir"> |
| 561 | if( fossil_strcmp(p->zFullName, zD)==0 ){ |
| 562 | @ <a>%h(p->zName)</a> |
| @@ -565,28 +563,28 @@ | |
| 563 | }else{ |
| 564 | char *zLink = href("%s", url_render(&sURI, "name", p->zFullName, 0, 0)); |
| 565 | @ %z(zLink)%h(p->zName)</a> |
| 566 | } |
| 567 | @ <ul class="filetree"> |
| 568 | }else{ |
| 569 | char *zLink; |
| 570 | if( zCI ){ |
| 571 | zLink = href("%R/artifact/%s",p->zUuid); |
| 572 | }else{ |
| 573 | zLink = href("%R/finfo?name=%T",p->zFullName); |
| 574 | } |
| 575 | @ <li class="file">%z(zLink)%h(p->zName)</a> |
| 576 | } |
| 577 | if( p->isLast ){ |
| 578 | int nClose = p->iLevel - (p->pNext ? p->pNext->iLevel : 0); |
| 579 | while( nClose-- > 0 ){ |
| 580 | @ </ul> |
| 581 | } |
| 582 | } |
| 583 | } |
| 584 | @ </ul> |
| 585 | @ </ul> |
| 586 | style_footer(); |
| 587 | |
| 588 | /* We could free memory used by sTree here if we needed to. But |
| 589 | ** the process is about to exit, so doing so would not really accomplish |
| 590 | ** anything useful. */ |
| 591 |