Blob Blame History Raw
--- util-linux-2.11y/text-utils/more.c.multibyte	2003-02-03 16:22:32.000000000 +0000
+++ util-linux-2.11y/text-utils/more.c	2003-02-03 17:03:45.000000000 +0000
@@ -1163,7 +1163,23 @@
 		    my_putstring(state ? ULenter : ULexit);
 	    }
 	    if (c != ' ' || pstate == 0 || state != 0 || ulglitch == 0)
+#ifdef ENABLE_WIDECHAR
+	    {
+		wchar_t wc;
+		size_t mblength;
+		mbstate_t state;
+		memset (&state, '\0', sizeof (mbstate_t));
+		s--; n++;
+		mblength = mbrtowc (&wc, s, n, &state);
+		if (mblength == (size_t) -2 || mblength == (size_t) -1)
+			mblength = 1;
+		while (mblength--)
+			putchar (*s++);
+		n += mblength;
+	    }
+#else
 	        putchar(c);
+#endif /* ENABLE_WIDECHAR */
 	    if (state && *chUL) {
 		pr(chBS);
 		my_putstring(chUL);