Files
2017-01-28 14:22:00 +01:00

61 lines
1.9 KiB
Diff

*** file.c.org 2009-06-29 09:17:41.000000000 +0200
--- file.c 2009-06-29 09:18:27.000000000 +0200
***************
*** 82,107 ****
char *table = table_nop; /* optionally invert bits in nibble */
register inc = 0; /* optionally swap nimmles */
int bits;
t = s = fbuf;
/* Does this look like an X bitmap ? */
if (sscanf(s, "#define %*s %d", &bits) == 1) {
if (bits == 48) {
! char type1[128];
! char type2[128];
while (*s && *s++ != '\n');
if (sscanf(s, "#define %*s %d", &bits) == 1) if (bits == 48) {
while (*s && *s++ != '\n');
! if (sscanf(s, "static %s %s", type1,type2)==2 &&
(!strcmp(type1, "char") ||
!strcmp(type2, "char"))) {
while (*s && *s++ != '\n');
inc = 1;
table = table_inv;
}
! else fprintf(stderr,
! "warning: xbitmap line 3 not static [unsigned] short ...\n");
}
else fprintf(stderr, "warning: xbitmaps must be 48x48\n");
}
--- 82,110 ----
char *table = table_nop; /* optionally invert bits in nibble */
register inc = 0; /* optionally swap nimmles */
int bits;
+ int len;
t = s = fbuf;
/* Does this look like an X bitmap ? */
if (sscanf(s, "#define %*s %d", &bits) == 1) {
if (bits == 48) {
! char type1[256];
! char type2[256];
while (*s && *s++ != '\n');
if (sscanf(s, "#define %*s %d", &bits) == 1) if (bits == 48) {
while (*s && *s++ != '\n');
! for (len=0; s[len] && s[len]!='\n'; len++);
! if (len<255) {
! if (sscanf(s, "static %s %s", type1,type2)==2 &&
(!strcmp(type1, "char") ||
!strcmp(type2, "char"))) {
while (*s && *s++ != '\n');
inc = 1;
table = table_inv;
}
! else fprintf(stderr, "warning: xbitmap line 3 not static [unsigned] short ...\n");
! } else fprintf(stderr, "warning: xbitmap line 3 too long\n");
}
else fprintf(stderr, "warning: xbitmaps must be 48x48\n");
}