Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH 1/1] package/htop: fix build without wchar
@ 2020-12-16  6:30 Fabrice Fontaine
  2020-12-31 16:32 ` Thomas Petazzoni
  0 siblings, 1 reply; 2+ messages in thread
From: Fabrice Fontaine @ 2020-12-16  6:30 UTC (permalink / raw)
  To: buildroot

Fixes:
 - http://autobuild.buildroot.org/results/5ad330244546e6f087425be816aea158a1f833cb

Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
---
 ...ter-restore-non-wide-character-build.patch | 32 +++++++++++++++++++
 1 file changed, 32 insertions(+)
 create mode 100644 package/htop/0001-Meter-restore-non-wide-character-build.patch

diff --git a/package/htop/0001-Meter-restore-non-wide-character-build.patch b/package/htop/0001-Meter-restore-non-wide-character-build.patch
new file mode 100644
index 0000000000..5f67d1f0f1
--- /dev/null
+++ b/package/htop/0001-Meter-restore-non-wide-character-build.patch
@@ -0,0 +1,32 @@
+From 79970f05f37677fe32aa804e493c5da747a2652f Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Christian=20G=C3=B6ttsche?= <cgzones@googlemail.com>
+Date: Tue, 15 Dec 2020 12:05:20 +0100
+Subject: [PATCH] Meter: restore non-wide-character build
+
+Use mbstowcs() only with wide ncurses support.
+
+Closes: #401
+
+[Retrieved from:
+https://github.com/htop-dev/htop/commit/79970f05f37677fe32aa804e493c5da747a2652f]
+Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
+---
+ Meter.c | 4 ++++
+ 1 file changed, 4 insertions(+)
+
+diff --git a/Meter.c b/Meter.c
+index b006a584..e849ea4a 100644
+--- a/Meter.c
++++ b/Meter.c
+@@ -196,7 +196,11 @@ static void BarMeterMode_draw(Meter* this, int x, int y, int w) {
+ 
+    // The text in the bar is right aligned;
+    // calculate needed padding and generate leading spaces
++#ifdef HAVE_LIBNCURSESW
+    const int textLen = mbstowcs(NULL, buffer, 0);
++#else
++   const int textLen = strlen(buffer);
++#endif
+    const int padding = CLAMP(w - textLen, 0, w);
+ 
+    RichString_begin(bar);
-- 
2.29.2

^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-12-31 16:32 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-12-16  6:30 [Buildroot] [PATCH 1/1] package/htop: fix build without wchar Fabrice Fontaine
2020-12-31 16:32 ` Thomas Petazzoni

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox