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,
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());
while (state == BODY) {
#ifdef LINUX_STDIO
if (scnout->_IO_write_ptr == scnout->_IO_write_end) {
+#elif defined(__DragonFly__)
+ if (((struct __FILE_public *)scnout)->_w <= 0) {
#else
if (scnout->_cnt <= 0) {
#endif
state = m_getfld(state, name, scnout->_IO_write_ptr,
(long)scnout->_IO_write_ptr-(long)scnout->_IO_write_end , inb);
scnout->_IO_write_ptr += msg_count;
+#elif defined(__DragonFly__)
+ state = m_getfld( state, name, ((struct __FILE_public *)scnout)->_p, -(((struct __FILE_public *)scnout)->_w), inb );
+ ((struct __FILE_public *)scnout)->_w -= msg_count;
+ ((struct __FILE_public *)scnout)->_p += msg_count;
#else
state = m_getfld( state, name, scnout->_ptr, -(scnout->_cnt), inb );
scnout->_cnt -= msg_count;