Merge commit 'b6162db44d0dc840c2c511100c8b0e630bf89b60' into front
This commit is contained in:
commit
e32f946a8a
1 changed files with 6 additions and 2 deletions
|
@ -129,7 +129,7 @@ rendermenu(Link *l, Biobuf *bp)
|
||||||
char *s, *f[5], *t;
|
char *s, *f[5], *t;
|
||||||
Gmenu *m;
|
Gmenu *m;
|
||||||
Link *n;
|
Link *n;
|
||||||
int type;
|
int type, c;
|
||||||
|
|
||||||
m = malloc(sizeof *m);
|
m = malloc(sizeof *m);
|
||||||
if(m==nil)
|
if(m==nil)
|
||||||
|
@ -143,7 +143,7 @@ rendermenu(Link *l, Biobuf *bp)
|
||||||
if(s==nil || s[0]=='.')
|
if(s==nil || s[0]=='.')
|
||||||
break;
|
break;
|
||||||
type = seltype(s[0]);
|
type = seltype(s[0]);
|
||||||
getfields(s+1, f, 5, 0, "\t\r\n");
|
c = getfields(s+1, f, 5, 0, "\t\r\n");
|
||||||
switch(type){
|
switch(type){
|
||||||
case Tinfo:
|
case Tinfo:
|
||||||
break;
|
break;
|
||||||
|
@ -151,6 +151,10 @@ rendermenu(Link *l, Biobuf *bp)
|
||||||
n = mklink(strdup(f[1]+4), nil, Thtml); /* +4 skip URL: */
|
n = mklink(strdup(f[1]+4), nil, Thtml); /* +4 skip URL: */
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
|
if(type < 0 && c < 3){
|
||||||
|
fprint(2, "skipping invalid menu line '%s'\n", s);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
n = mklink(netmkaddr(f[2], "tcp", f[3]), strdup(f[1]), type);
|
n = mklink(netmkaddr(f[2], "tcp", f[3]), strdup(f[1]), type);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue