summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorcinap_lenrek <cinap_lenrek@centraldogma>2011-09-24 08:51:19 +0200
committercinap_lenrek <cinap_lenrek@centraldogma>2011-09-24 08:51:19 +0200
commit72989ba9cb9946e489363855ea6a85a931f6990b (patch)
tree5ff31f012870ab09bb237964dfe2866d2a3e45b2
parentec70fc64ad6e5072f83ce672f20ae200055fe0eb (diff)
downloadplan9front-72989ba9cb9946e489363855ea6a85a931f6990b.tar.xz
mothra: fix j command
-rw-r--r--sys/src/cmd/mothra/mothra.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/sys/src/cmd/mothra/mothra.c b/sys/src/cmd/mothra/mothra.c
index dc2ef56ce..fc9c7c40f 100644
--- a/sys/src/cmd/mothra/mothra.c
+++ b/sys/src/cmd/mothra/mothra.c
@@ -540,11 +540,11 @@ void docmd(Panel *p, char *s){
else geturl(s, GET, 0, 1, 0);
break;
case 'j':
- s=arg(s);
+ s = arg(s);
if(*s)
- geturl(www(atoi(s)-1)->url->fullname, GET, 0, 0, 0);
+ 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 hiturl(int buttons, char *url, int map){
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){