git: 9front

Download patch

ref: 73f720277a23b5897b94339daf4b2d950ceb38a0
parent: fcb29de25ef3fc4ae82f09bf39e92447aaa51d85
author: stanley lieber <stanley.lieber@gmail.com>
date: Thu Sep 22 21:36:44 EDT 2011

mothra: do not crash on an invalid j command

--- a/sys/src/cmd/mothra/mothra.c
+++ b/sys/src/cmd/mothra/mothra.c
@@ -541,7 +541,7 @@
 		break;
 	case 'j':
 		s=arg(s);
-		if(*s)
+		if(atoi(s) <= nwww())
 			geturl(www(atoi(s)-1)->url->fullname, GET, 0, 0, 0);
 		else
 			message("no url selected");
--