git: 9front

Download patch

ref: 063fd7f3ff49ab42767f19b420d09aafae956aa7
parent: 73f720277a23b5897b94339daf4b2d950ceb38a0
author: cinap_lenrek <cinap_lenrek@centraldogma>
date: Sat Sep 24 04:52:45 EDT 2011

merge

--- a/sys/src/cmd/mothra/mothra.c
+++ b/sys/src/cmd/mothra/mothra.c
@@ -540,11 +540,11 @@
 		else geturl(s, GET, 0, 1, 0);
 		break;
 	case 'j':
-		s=arg(s);
-		if(atoi(s) <= nwww())
-			geturl(www(atoi(s)-1)->url->fullname, GET, 0, 0, 0);
+		s = arg(s);
+		if(*s)
+			doprev(nil, 1, wwwtop-atoi(s));
 		else
-			message("no url selected");
+			message("Usgae: j index");
 		break;
 	case 'r':
 		s = arg(s);
@@ -601,7 +601,7 @@
 void doprev(Panel *p, int buttons, int index){
 	int i;
 	USED(p);
-	if(index >= nwww())
+	if(index < 0 || index >= nwww())
 		return;
 	i = wwwtop-index-1;
 	switch(buttons){
--