rpms/mc/devel mc-utf8-8bit-hex.patch,NONE,1.1 mc.spec,1.101,1.102

fedora-cvs-commits at redhat.com fedora-cvs-commits at redhat.com
Tue Sep 5 12:52:14 UTC 2006


Author: jnovy

Update of /cvs/dist/rpms/mc/devel
In directory cvs.devel.redhat.com:/tmp/cvs-serv29768

Modified Files:
	mc.spec 
Added Files:
	mc-utf8-8bit-hex.patch 
Log Message:
- display hex values correctly even for non-UTF8 locales, thanks
  to Egmont Koblinger
- fix BuildRoot


mc-utf8-8bit-hex.patch:
 editdraw.c |   12 +++++++++++-
 1 files changed, 11 insertions(+), 1 deletion(-)

--- NEW FILE mc-utf8-8bit-hex.patch ---
--- mc-2006-08-12-18/edit/editdraw.c.8bit-hex	2006-09-05 14:35:21.000000000 +0200
+++ mc-2006-08-12-18/edit/editdraw.c	2006-09-05 14:35:21.000000000 +0200
@@ -70,12 +70,22 @@
      */
     if (edit->curs1 < edit->last_byte) {
         mc_wchar_t cur_byte = edit_get_byte (edit, edit->curs1);
+        mc_wchar_t cur_byte2 = cur_byte;
 #ifndef UTF8
 	g_snprintf (byte_str, sizeof (byte_str), "%c %3d 0x%02X",
 		    is_printable (cur_byte) ? cur_byte : '.',
 #else /* UTF8 */
+        /* In 8-bit locales show the byte itself instead of its Unicode value */
+        if (MB_CUR_MAX == 1) {
+            unsigned char cur_8bit_byte;
+            mbstate_t mbs;
+            memset (&mbs, 0, sizeof (mbs));
+            if (wcrtomb(&cur_8bit_byte, cur_byte, &mbs) == 1) {
+                cur_byte = cur_8bit_byte;
+            }
+        }
         g_snprintf (byte_str, sizeof(byte_str), "%lc %3d 0x%02X",
-                    iswprint(cur_byte) ? cur_byte : '.',
+                    iswprint(cur_byte2) ? cur_byte2 : '.',
 #endif /* UTF8 */
                     (int) cur_byte,
                     (unsigned) cur_byte);


Index: mc.spec
===================================================================
RCS file: /cvs/dist/rpms/mc/devel/mc.spec,v
retrieving revision 1.101
retrieving revision 1.102
diff -u -r1.101 -r1.102
--- mc.spec	2 Sep 2006 09:20:56 -0000	1.101
+++ mc.spec	5 Sep 2006 12:52:12 -0000	1.102
@@ -3,13 +3,13 @@
 Summary:	User-friendly text console file manager and visual shell
 Name:		mc
 Version:	4.6.1a
-Release:	26%{?dist}
+Release:	27%{?dist}
 Epoch:		1
 License:	GPL
 Group:		System Environment/Shells
 Source0:	http://www.ibiblio.org/pub/Linux/utils/file/managers/mc/snapshots/mc-%{date}.tar.gz
 URL:		http://www.ibiblio.org/mc/
-BuildRoot:	%{_tmppath}/%{name}-%{version}-root
+BuildRoot:	%{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
 BuildRequires:	glib2-devel e2fsprogs-devel slang-devel
 Requires:	dev >= 0:3.3-3
 
@@ -28,6 +28,7 @@
 Patch13:	mc-fishfix.patch
 Patch14:	mc-assembly.patch
 Patch15:	mc-spec.patch
+Patch16:	mc-utf8-8bit-hex.patch
 
 %description
 Midnight Commander is a visual shell much like a file manager, only
@@ -54,6 +55,7 @@
 %patch13 -p1 -b .fishfix
 %patch14 -p1 -b .assembly
 %patch15 -p1 -b .spec
+%patch16 -p1 -b .8bit-hex
 
 # convert files in /lib to UTF-8
 pushd lib
@@ -198,6 +200,11 @@
 %dir %{_sysconfdir}/mc
 
 %changelog
+* Tue Sep  5 2006 Jindrich Novy <jnovy at redhat.com> 4.6.1a-27.fc6
+- display hex values correctly even for non-UTF8 locales, thanks
+  to Egmont Koblinger
+- fix BuildRoot
+
 * Sat Sep  2 2006 Jindrich Novy <jnovy at redhat.com> 4.6.1a-26.fc6
 - correctly highlight Requires(pre,post,preun,postun) in spec
 




More information about the fedora-cvs-commits mailing list