summaryrefslogtreecommitdiff
path: root/www/links
diff options
context:
space:
mode:
authoris <is@pkgsrc.org>2003-01-15 16:15:12 +0000
committeris <is@pkgsrc.org>2003-01-15 16:15:12 +0000
commitfba275f92e8889bcda9f66fe3daddd100bc08abe (patch)
treef5b64c66ae4b090cf86ee09d27886a6ffad0ce96 /www/links
parent8ccc797c5a976c9bcafc5d20a51d7190deeeaab1 (diff)
downloadpkgsrc-fba275f92e8889bcda9f66fe3daddd100bc08abe.tar.gz
Patch for inlined xbm files, by Petr Kulhavy
Diffstat (limited to 'www/links')
-rw-r--r--www/links/patches/patch-ae69
1 files changed, 69 insertions, 0 deletions
diff --git a/www/links/patches/patch-ae b/www/links/patches/patch-ae
new file mode 100644
index 00000000000..20b6dc7bcd8
--- /dev/null
+++ b/www/links/patches/patch-ae
@@ -0,0 +1,69 @@
+$NetBSD: patch-ae,v 1.1 2003/01/15 16:15:12 is Exp $
+
+--- xbm.c.orig Wed May 22 18:15:08 2002
++++ xbm.c Wed Jan 15 16:24:28 2003
+@@ -28,6 +28,7 @@
+ int pixels; /* velikost cimg->buffer v pixelech */
+ int state; /* stav automatu na zrani komentaru */
+ int actual_eight; /* aktualni cislo, ktere se ma putnout do cimg */
++ int line_pos; /* aktualni pozice pixelu na radce (kolik pixelu v cimg->buffer je platnych na momentalne zpracovavane radce) */
+ unsigned char barvicky[6]; /* 0-2 background, 3-5 foreground */
+ /*
+ * stavy:
+@@ -86,16 +87,18 @@
+ static int b=10;
+ static int d=0;
+ int retval;
++ int was_partnum=*partnum;
+ *partnum=0;
+
+ dalsi_runda:
+ if (!(*l))return a;
+ **p=tolower(**p);
+- if (b==10&&((**p)<'0'||(**p)>'9'))return a; /* tohle neni cislo, to si strc nekam... */
+- if (b==16&&((**p)<'a'||(**p>'f'))&&((**p)<'0'||(**p)>'9'))return a;
++ if (!was_partnum&&b==10&&((**p)<'0'||(**p)>'9'))goto smitec; /* tohle neni cislo, to si strc nekam... */
++ if (b==16&&((**p)<'a'||(**p>'f'))&&((**p)<'0'||(**p)>'9'))goto smitec;
+ if (a==-1)a=0;
+ for (;*l&&(((**p)>='0'&&(**p)<='9')||(b==16&&(**p)>='a'&&(**p)<='f'));(*l)--,(*p)++){d++;a*=b;a+=((**p)>='a'?10+(**p)-'a':(**p)-'0');}
+- if (b==10&&!a&&(*l)&&((**p)|32)=='x'){b=16;d=0;(*p)++;(*l)--;goto dalsi_runda;}
++ if (b==10&&!a&&(*l)&&((**p)|32)=='x'){b=16;d=0;(*p)++;(*l)--;if (!*l)*partnum=1;goto dalsi_runda;}
++ smitec:
+ retval=a;
+ if (!*l)*partnum=1;
+ else a=-1,*base=b,b=10,*digits=d,d=0;
+@@ -118,13 +121,15 @@
+ static inline void put_eight(struct cached_image *cimg,int bits)
+ {
+ struct xbm_decoder *deco=(struct xbm_decoder *)cimg->decoder;
+- int a;
++ int ten_napis_v_s3_nekecal;
+
+- for (a=0;a<bits&&deco->image_pos<deco->pixels;a++,deco->image_pos++)
+- {
+- memcpy(cimg->buffer+deco->image_pos*3,deco->barvicky+((deco->actual_eight)&1)*3,3);
+- deco->actual_eight>>=1;
+- }
++ for (ten_napis_v_s3_nekecal=0;ten_napis_v_s3_nekecal<bits&&deco->image_pos<deco->pixels&&deco->line_pos<cimg->width;ten_napis_v_s3_nekecal++,deco->image_pos++,deco->line_pos++)
++ {
++ memcpy(cimg->buffer+deco->image_pos*3,deco->barvicky+((deco->actual_eight)&1)*3,3);
++ deco->actual_eight>>=1;
++ }
++ if (deco->line_pos==cimg->width)
++ deco->line_pos=0,deco->actual_eight=0;
+ }
+
+
+@@ -220,10 +225,12 @@
+ deco->buffer_pos-=p-deco->buffer;
+ deco->image_pos=0;
+ deco->pixels=deco->width*deco->height;
++ deco->line_pos=0;
+ }
+ p=deco->buffer;
+ a=deco->buffer_pos;
+ if (!deco->partnum) __skip_whitespace(&p,&a);
++ if (!a){must_return=1; goto restart_again;}
+ deco->actual_eight=__read_num(&p,&a,&(deco->partnum),&d,&b);
+ memmove(deco->buffer,p,a);
+ deco->buffer_pos=a;