From 050fd1d8cecc02b91992967657546f685e130a35 Mon Sep 17 00:00:00 2001 From: yueyaoqiang Date: Thu, 25 Jul 2024 15:43:44 +0800 Subject: [PATCH] fix gb18030 for ps --- fix-gb18030-for-ps.patch | 51 ++++++++++++++++++++++++++++++++++++++++ procps-ng.spec | 6 ++++- 2 files changed, 56 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..06ca74f --- /dev/null +++ b/fix-gb18030-for-ps.patch @@ -0,0 +1,51 @@ +From 4744868aa63b3e07728cb7641dd98dd78237d829 Mon Sep 17 00:00:00 2001 +From: yueyaoqiang +Date: Thu, 5 Sep 2019 23:56:40 +0800 +Subject: [PATCH] fix gb18030 for ps + +--- + proc/escape.c | 14 +++++++++++++- + 1 file changed, 13 insertions(+), 1 deletion(-) + +diff --git a/proc/escape.c b/proc/escape.c +index 5cd6877..6d791f3 100644 +--- a/proc/escape.c ++++ b/proc/escape.c +@@ -134,6 +134,7 @@ int escape_str(char *restrict dst, const char *restrict src, int bufsize, int *m + int my_cells = 0; + int my_bytes = 0; + const char codes[] = ++#if 0 + "Z..............................." + "||||||||||||||||||||||||||||||||" + "||||||||||||||||||||||||||||||||" +@@ -142,6 +143,16 @@ int escape_str(char *restrict dst, const char *restrict src, int bufsize, int *m + "????????????????????????????????" + "????????????????????????????????" + "????????????????????????????????"; ++#else ++ "Z-------------------------------" ++ "********************************" ++ "********************************" ++ "*******************************-" ++ "--------------------------------" ++ "********************************" ++ "********************************" ++ "********************************"; ++#endif + + #if (__GNU_LIBRARY__ >= 6) && (!defined(__UCLIBC__) || defined(__UCLIBC_HAS_WCHAR__)) + static int utf_init=0; +@@ -165,7 +176,8 @@ int escape_str(char *restrict dst, const char *restrict src, int bufsize, int *m + 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; +-- +2.27.0 + 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