summaryrefslogtreecommitdiff
path: root/sys/src/cmd/mothra/mothra.c
diff options
context:
space:
mode:
authorcinap_lenrek <cinap_lenrek@gmx.de>2012-09-22 17:46:56 +0200
committercinap_lenrek <cinap_lenrek@gmx.de>2012-09-22 17:46:56 +0200
commitf34ef5a8d43bdf2728cefb12707be8ea4f2052bb (patch)
tree3b081e8e80d5e167bf2a5ece3bc35e19063ad66d /sys/src/cmd/mothra/mothra.c
parent9a06f93b71e339741ac6078a0246e11e789aa784 (diff)
mothra: first attempt on text selection
Diffstat (limited to 'sys/src/cmd/mothra/mothra.c')
-rw-r--r--sys/src/cmd/mothra/mothra.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/sys/src/cmd/mothra/mothra.c b/sys/src/cmd/mothra/mothra.c
index 058d58d64..ecd724d31 100644
--- a/sys/src/cmd/mothra/mothra.c
+++ b/sys/src/cmd/mothra/mothra.c
@@ -90,7 +90,7 @@ void killpix(Www *w);
char *buttons[]={
"alt display",
"moth mode",
- "snarf url",
+ "snarf",
"paste",
"save hit",
"hit list",
@@ -1015,9 +1015,14 @@ void killpix(Www *w){
}
void snarf(Panel *p){
+ char *s;
int fd;
+
if((fd=open("/dev/snarf", OWRITE|OTRUNC))>=0){
- fprint(fd, "%s", urlstr(selection));
+ s = plsnarftext(text);
+ if(s==0)
+ s = urlstr(selection);
+ fprint(fd, "%s", s);
close(fd);
}
}