From 76a4d84f63e346768dac201e6ede69a4147f7332 Mon Sep 17 00:00:00 2001 From: yueyaoqiang Date: Fri, 7 Jun 2024 14:57:07 +0800 Subject: [PATCH] fix gb18030 for ps --- fix-gb18030-for-ps.patch | 38 ++++++++++++++++++++++++++++++++++++++ procps-ng.spec | 6 +++++- 2 files changed, 43 insertions(+), 1 deletion(-) create mode 100644 fix-gb18030-for-ps.patch diff --git a/fix-gb18030-for-ps.patch b/fix-gb18030-for-ps.patch new file mode 100644 index 0000000..f520cce --- /dev/null +++ b/fix-gb18030-for-ps.patch @@ -0,0 +1,38 @@ +diff -Nur procps-ng-3.3.16.bak/proc/escape.c procps-ng-3.3.16/proc/escape.c +--- procps-ng-3.3.16.bak/proc/escape.c 2024-05-23 19:34:04.688824171 +0800 ++++ procps-ng-3.3.16/proc/escape.c 2024-05-23 19:36:02.869830795 +0800 +@@ -134,6 +134,7 @@ + int my_cells = 0; + int my_bytes = 0; + const char codes[] = ++#if 0 + "Z..............................." + "||||||||||||||||||||||||||||||||" + "||||||||||||||||||||||||||||||||" +@@ -142,6 +143,16 @@ + "????????????????????????????????" + "????????????????????????????????" + "????????????????????????????????"; ++#else ++ "Z-------------------------------" ++ "********************************" ++ "********************************" ++ "*******************************-" ++ "--------------------------------" ++ "********************************" ++ "********************************" ++ "********************************"; ++#endif + + #if (__GNU_LIBRARY__ >= 6) && (!defined(__UCLIBC__) || defined(__UCLIBC_HAS_WCHAR__)) + static int utf_init=0; +@@ -165,7 +176,8 @@ + break; + c = (unsigned char) *(src++); + if(!c) break; +- if(codes[c]!='|') c=codes[c]; ++ //if(codes[c]!='|') c=codes[c]; ++ if(codes[c]=='-') c='?'; + my_cells++; + my_bytes++; + *(dst++) = c; diff --git a/procps-ng.spec b/procps-ng.spec index c8f0afc..21f963d 100644 --- a/procps-ng.spec +++ b/procps-ng.spec @@ -1,6 +1,6 @@ Name: procps-ng Version: 3.3.16 -Release: 20 +Release: 21 Summary: Utilities that provide system information. License: GPL+ and GPLv2 and GPLv2+ and GPLv3+ and LGPLv2+ URL: https://sourceforge.net/projects/procps-ng/ @@ -27,6 +27,7 @@ Patch0013: backport-0014-ps-Fix-possible-buffer-overflow-in-C-option.patch Patch9000: feature-add-options-M-and-N-for-top.patch Patch9001: bugfix-top-exit-with-error-when-pid-overflow.patch Patch9002: pgrep-uid-gid-overflow.patch +Patch9003: fix-gb18030-for-ps.patch Recommends: %{name}-help = %{version}-%{release} BuildRequires: ncurses-devel libtool autoconf automake gcc gettext-devel systemd-devel @@ -113,6 +114,9 @@ ln -s %{_bindir}/pidof %{buildroot}%{_sbindir}/pidof %{_mandir}/translated %changelog +* Thu Jun 06 2024 yueyaoqiang - 3.3.16-21 +- DESC:fix gb18030 for ps + * Thu Mar 21 2024 cenhuilin - 3.3.16-20 - fix uid gid overflow -- Gitee