From efb5c93becea5c7b590923cd4b667d91c90b4e36 Mon Sep 17 00:00:00 2001 From: gt7-void Date: Mon, 13 Jan 2020 12:03:49 -0300 Subject: [PATCH] mcpp: fix set_encoding() to understand C.UTF-8 --- srcpkgs/mcpp/patches/mbchar.patch | 29 +++++++++++++++++++++++++++++ srcpkgs/mcpp/template | 2 +- 2 files changed, 30 insertions(+), 1 deletion(-) create mode 100644 srcpkgs/mcpp/patches/mbchar.patch diff --git a/srcpkgs/mcpp/patches/mbchar.patch b/srcpkgs/mcpp/patches/mbchar.patch new file mode 100644 index 00000000000..1929e3d7f0d --- /dev/null +++ b/srcpkgs/mcpp/patches/mbchar.patch @@ -0,0 +1,29 @@ +Fix set_encoding() to understand C.UTF-8 and other +locale names with != 5 characters before . + +--- src/mbchar.c 2008-03-08 11:06:13.000000000 -0200 ++++ src/mbchar.c 2020-01-13 10:02:20.800174591 -0300 +@@ -366,6 +366,7 @@ + = "Too long encoding name: %s%.0ld%.0s"; /* _E_ */ + const char * loc = ""; + int alias; ++ char *dot; + char norm[ NAMLEN]; + /* + * Normalized name (removed 'xxxxx.', stripped '_', '-', '.' +@@ -380,10 +381,11 @@ + mcpp_fputc( '\n', ERR); + } + } +- strcpy( norm, name); +- if (norm[ 5] == '.') +- memmove( norm, norm + 5, strlen( norm + 5) + 1); +- /* Remove initial 'xxxxx.' as 'ja_JP.', 'en_US.' or any other */ ++ if ( dot = strchr( name, '.' ) ) ++ /* Remove initial 'xxxxx.' as 'ja_JP.', 'en_US.', 'C.' or any other */ ++ strcpy( norm, dot+1); ++ else ++ strcpy( norm, name); + conv_case( norm, norm + strlen( norm), LOWER); + strip_bar( norm); + diff --git a/srcpkgs/mcpp/template b/srcpkgs/mcpp/template index 08eae32e871..7a358883d06 100644 --- a/srcpkgs/mcpp/template +++ b/srcpkgs/mcpp/template @@ -1,7 +1,7 @@ # Template file for 'mcpp' pkgname=mcpp version=2.7.2 -revision=7 +revision=8 build_style=gnu-configure configure_args="--enable-mcpplib" short_desc="Portable C preprocessor"