shithub: shithub

Download patch

ref: 590d838436017f81ff4e2aa8f939316254126e38
parent: 2554914e78687e6d2a4d1e46b7117b86da6a4a62
author: Ori Bernstein <ori@eigenstate.org>
date: Mon Nov 30 00:41:06 EST 2020

list: fix <dl>..</dl> generation

We were comparing against the empty list when deciding
to close a tag, instead of the previous value -- so we
would always close a tag early.

--- a/shithub
+++ b/shithub
@@ -88,11 +88,12 @@
 	udir=()
 	for(repo in `$nl{ls */}){
 		ndir=`{basename -d $repo}
-		if(! ~ $udir)
+		if(! ~ $udir $ndir)
 			echo '</dl>'
 		if(! ~ $udir $ndir){
 			echo '<h3>'$ndir'</h3>'
 			echo '<dl>'
+			udir=$ndir
 		}
 		if(test -e $repo/.git/webpublish){
 			echo '<dt><a href="/git/'$repo'/HEAD/info.html">'$repo'</a></dt>'
@@ -105,7 +106,6 @@
 				echo 'code some guy wrote'
 			echo '</dd>'
 		}
-		udir=$ndir
 	}
 
 case 'tar'