summaryrefslogtreecommitdiff
path: root/sys/src/cmd/mothra/rdhtml.c
diff options
context:
space:
mode:
author23hiro <23hiro@gmail.com>2018-06-27 19:20:28 +0200
committer23hiro <23hiro@gmail.com>2018-06-27 19:20:28 +0200
commit2f1b8246e23f8d3e88885822efcf25f3b4474bff (patch)
treeb815f509ffdbd10c565a9b2edf74fc2d79dc749f /sys/src/cmd/mothra/rdhtml.c
parent902eceee63f5132f315db1a15ecce95af51359df (diff)
Persist 'k' command in mothra and add matching -k flag (thanks piroko)
"I sometimes find myself on either slow or data-capped network links where downloading images isn't ideal. Attached is a simple patch to mothra that changes the 'k' command to not only remove already-downloaded images from a page, but also toggle a state such that mothra won't attempt to download images on future visited sites until 'k' is toggled again. This also adds a '-k' flag to mothra which enables the flag at startup." --Jeremy O'Brien<neutral@fastmail.com> on 9fans
Diffstat (limited to 'sys/src/cmd/mothra/rdhtml.c')
-rw-r--r--sys/src/cmd/mothra/rdhtml.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/sys/src/cmd/mothra/rdhtml.c b/sys/src/cmd/mothra/rdhtml.c
index 912300adb..3050f1f5a 100644
--- a/sys/src/cmd/mothra/rdhtml.c
+++ b/sys/src/cmd/mothra/rdhtml.c
@@ -704,7 +704,7 @@ void plrdplain(char *name, int fd, Www *dst){
plaintext(&g);
finish(dst);
}
-void plrdhtml(char *name, int fd, Www *dst){
+void plrdhtml(char *name, int fd, Www *dst, int killimgs){
int tagerr;
Stack *sp;
char buf[20];
@@ -1222,7 +1222,8 @@ void plrdhtml(char *name, int fd, Www *dst){
}
pl_popstate(g.state);
*g.tp='\0';
- getpix(dst->text, dst);
+ if (!killimgs)
+ getpix(dst->text, dst);
finish(dst);
return;
}