CVSROOT:        /cvsroot/nmh
Module name:    nmh
Changes by:     Peter Maydell <pm215>   08/05/22 10:37:56

Modified files:
        uip            : scansbr.c 
        .              : ChangeLog 

Log message:
        Don't use MB_CUR_MAX if we aren't compiled with multibyte support.

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/nmh/uip/scansbr.c?cvsroot=nmh&r1=1.11&r2=1.12
http://cvs.savannah.gnu.org/viewcvs/nmh/ChangeLog?cvsroot=nmh&r1=1.270&r2=1.271

Patches:
Index: uip/scansbr.c
===================================================================
RCS file: /cvsroot/nmh/nmh/uip/scansbr.c,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -b -r1.11 -r1.12
--- uip/scansbr.c       13 Apr 2007 11:53:08 -0000      1.11
+++ uip/scansbr.c       22 May 2008 10:37:55 -0000      1.12
@@ -2,7 +2,7 @@
 /*
  * scansbr.c -- routines to help scan along...
  *
- * $Id: scansbr.c,v 1.11 2007/04/13 11:53:08 jjr Exp $
+ * $Id: scansbr.c,v 1.12 2008/05/22 10:37:55 pm215 Exp $
  *
  * This code is Copyright (c) 2002, by the authors of nmh.  See the
  * COPYRIGHT file in the root directory of the nmh distribution for
@@ -68,6 +68,11 @@
 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,
@@ -98,7 +103,7 @@
                width = MAXSCANL;
        }
        dat[3] = slwidth = width;
-       scanl = (char *) mh_xmalloc((size_t) MB_CUR_MAX * (slwidth + 2) );
+       scanl = (char *) mh_xmalloc((size_t) SCAN_CHARWIDTH * (slwidth + 2) );
        if (outnum)
            umask(~m_gmprot());
 

Index: ChangeLog
===================================================================
RCS file: /cvsroot/nmh/nmh/ChangeLog,v
retrieving revision 1.270
retrieving revision 1.271
diff -u -b -r1.270 -r1.271
--- ChangeLog   22 May 2008 10:21:48 -0000      1.270
+++ ChangeLog   22 May 2008 10:37:55 -0000      1.271
@@ -1,5 +1,8 @@
 2008-05-22  Peter Maydell  <[EMAIL PROTECTED]>
 
+       * uip/scansbr.c: don't use MB_CUR_MAX if we aren't compiled
+       with multibyte support.
+
        * uip/whatnowsbr.c: factor out common code for writing ls
        shell command, and make it do more sensible buffer length
        checks. Also avoid relying on the return value of sprintf(),


_______________________________________________
Nmh-commits mailing list
[email protected]
http://lists.nongnu.org/mailman/listinfo/nmh-commits

Reply via email to