mothra: fix selurl()
This commit is contained in:
parent
0140f20af4
commit
d6fb42f496
1 changed files with 18 additions and 18 deletions
|
@ -942,24 +942,6 @@ urlstr(Url *url){
|
||||||
return url->fullname;
|
return url->fullname;
|
||||||
return url->reltext;
|
return url->reltext;
|
||||||
}
|
}
|
||||||
Url* selurl(char *urlname){
|
|
||||||
static Url url;
|
|
||||||
|
|
||||||
free(url.reltext);
|
|
||||||
free(url.basename);
|
|
||||||
seturl(&url, urlname, current ? current->url->fullname : "");
|
|
||||||
selection=&url;
|
|
||||||
message("selected: %s", urlstr(selection));
|
|
||||||
plgrabkb(cmd); /* for snarf */
|
|
||||||
return selection;
|
|
||||||
}
|
|
||||||
void seturl(Url *url, char *urlname, char *base){
|
|
||||||
url->reltext = strdup(urlname);
|
|
||||||
url->basename = strdup(base);
|
|
||||||
url->fullname[0] = 0;
|
|
||||||
url->tag[0] = 0;
|
|
||||||
url->map = 0;
|
|
||||||
}
|
|
||||||
Url *copyurl(Url *u){
|
Url *copyurl(Url *u){
|
||||||
Url *v;
|
Url *v;
|
||||||
v=emalloc(sizeof(Url));
|
v=emalloc(sizeof(Url));
|
||||||
|
@ -973,6 +955,24 @@ void freeurl(Url *u){
|
||||||
free(u->basename);
|
free(u->basename);
|
||||||
free(u);
|
free(u);
|
||||||
}
|
}
|
||||||
|
void seturl(Url *url, char *urlname, char *base){
|
||||||
|
url->reltext = strdup(urlname);
|
||||||
|
url->basename = strdup(base);
|
||||||
|
url->fullname[0] = 0;
|
||||||
|
url->tag[0] = 0;
|
||||||
|
url->map = 0;
|
||||||
|
}
|
||||||
|
Url* selurl(char *urlname){
|
||||||
|
Url *last;
|
||||||
|
|
||||||
|
last=selection;
|
||||||
|
selection=emalloc(sizeof(Url));
|
||||||
|
seturl(selection, urlname, current ? current->url->fullname : "");
|
||||||
|
if(last) freeurl(last);
|
||||||
|
message("selected: %s", urlstr(selection));
|
||||||
|
plgrabkb(cmd); /* for snarf */
|
||||||
|
return selection;
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* get the file at the given url
|
* get the file at the given url
|
||||||
|
|
Loading…
Reference in a new issue