X-Git-Url: http://git.marmaro.de/?a=blobdiff_plain;f=uip%2Fscansbr.c;h=6a9278bbd539895d2f636d2c8a16abba032c45cc;hb=25c0bc3f1c034964421f8007e5802c647c5dc908;hp=b178e75955a5944a0d226366e0894ae625b9c0a2;hpb=81a21a9a97d8633f6d6231e31fdb6e328d0d3ff2;p=mmh diff --git a/uip/scansbr.c b/uip/scansbr.c index b178e75..6a9278b 100644 --- a/uip/scansbr.c +++ b/uip/scansbr.c @@ -68,13 +68,19 @@ char *scanl = 0; /* text of most recent scanline */ int sc_width (void); /* from termsbr.c */ static int mh_fputs(char *, FILE *); +#ifdef MULTIBYTE_SUPPORT +#define SCAN_CHARWIDTH MB_CUR_MAX +#else +#define SCAN_CHARWIDTH 1 +#endif int scan (FILE *inb, int innum, int outnum, char *nfs, int width, int curflg, int unseen, char *folder, long size, int noisy) { int i, compnum, encrypted, state; - char *cp, *tmpbuf, **nxtbuf; + unsigned char *cp, *tmpbuf; + char **nxtbuf; char *saved_c_text; struct comp *cptr; struct comp **savecomp; @@ -97,7 +103,7 @@ scan (FILE *inb, int innum, int outnum, char *nfs, int width, int curflg, width = MAXSCANL; } dat[3] = slwidth = width; - scanl = (char *) mh_xmalloc((size_t) (slwidth + 2) ); + scanl = (char *) mh_xmalloc((size_t) SCAN_CHARWIDTH * (slwidth + 2) ); if (outnum) umask(~m_gmprot()); @@ -203,7 +209,7 @@ scan (FILE *inb, int innum, int outnum, char *nfs, int width, int curflg, */ if ((cptr = wantcomp[CHASH(name)])) { do { - if (!strcasecmp(name, cptr->c_name)) { + if (!mh_strcasecmp(name, cptr->c_name)) { if (! cptr->c_text) { cptr->c_text = tmpbuf; for (cp = tmpbuf + strlen (tmpbuf) - 1;