void-packages/srcpkgs/dialog/patches/trim-blank.patch
Jürgen Buchmüller 49a764352c
dialog: fix "no blanks" issue w/ BE targets
Signed-off-by: Jürgen Buchmüller <pullmoll@t-online.de>
2019-05-30 10:47:39 +02:00

21 lines
621 B
Diff

Source: @pullmoll
Upstream: no (should be queried)
Reason: fix issue with dialog dropping blanks (BE targets)
The conversion of isblank() to int is vague thus use constants.
Pre decrement the dst ptr and test for it being greater than base.
--- util.c 2018-06-22 01:47:10.000000000 +0200
+++ util.c 2019-05-30 10:35:00.517648968 +0200
@@ -2330,9 +2330,9 @@
static bool
trim_blank(char *base, char *dst)
{
- int count = isblank(UCH(*dst));
+ int count = isblank(UCH(*dst)) ? 1 : 0;
- while (dst-- != base) {
+ while (--dst > base) {
if (*dst == '\n') {
break;
} else if (isblank(UCH(*dst))) {