diff --git a/gawk-3.1.7-prec-utf8.patch b/gawk-3.1.7-prec-utf8.patch new file mode 100644 index 0000000..1e9e52d --- /dev/null +++ b/gawk-3.1.7-prec-utf8.patch @@ -0,0 +1,23 @@ +--- gawk-3.1.7/builtin.c.orig 2010-04-01 15:52:45.000000000 +0200 ++++ gawk-3.1.7/builtin.c 2010-04-01 15:57:17.000000000 +0200 +@@ -1218,9 +1218,18 @@ check_pos: + if (fw == 0 && ! have_prec) + ; + else if (gawk_mb_cur_max > 1 && (cs1 == 's' || cs1 == 'c')) { ++ int nchars_needed = 0; ++ + assert(cp == arg->stptr || cp == cpbuf); +- copy_count = mbc_byte_count(arg->stptr, +- cs1 == 's' ? arg->stlen : 1); ++ ++ if (cs1 == 'c') ++ nchars_needed = 1; ++ else if (have_prec) ++ nchars_needed = prec; ++ else ++ nchars_needed = arg->stlen; ++ ++ copy_count = mbc_byte_count(arg->stptr, nchars_needed); + } + bchunk(cp, copy_count); + while (fw > prec) { diff --git a/gawk.spec b/gawk.spec index 46cdd79..f937fd3 100644 --- a/gawk.spec +++ b/gawk.spec @@ -1,13 +1,14 @@ Summary: The GNU version of the awk text processing utility Name: gawk Version: 3.1.7 -Release: 2%{?dist} +Release: 3%{?dist} License: GPLv3+ Group: Applications/Text URL: http://www.gnu.org/software/gawk/gawk.html Source0: http://ftp.gnu.org/gnu/gawk/gawk-%{version}.tar.xz # Patch from Arnold, the upstream maintainer: Patch0: gawk-posix-mode-argv0.patch +Patch1: gawk-3.1.7-prec-utf8.patch BuildRoot: %(mktemp -ud %{_tmppath}/%{name}-%{version}-%{release}-XXXXXX) Requires(post): /sbin/install-info @@ -24,6 +25,7 @@ considered to be a standard Linux tool for processing text. %prep %setup -q %patch0 +%patch1 -p1 -b .prec-utf8 %build %configure --bindir=/bin --disable-libsigsegv @@ -72,6 +74,9 @@ fi %{_datadir}/awk %changelog +* Thu Apr 01 2010 Jan Zeleny - 3.1.7-3 +- fix issue with utf8 precision recognition (#513234) + * Thu Oct 8 2009 Stepan Kasal - 3.1.7-2 - in posix mode, make ARGV[0] = argv[0] (#525381)