linuxOS_AP05/buildroot/package/busybox/0003-busybox-support-chinese-display-in-terminal.patch
2025-06-02 13:59:07 +08:00

59 lines
1.6 KiB
Diff

From eb3ae4ea53dde8018524a0ed9dc08a65625197cc Mon Sep 17 00:00:00 2001
From: "hero.huang" <hero.huang@rock-chips.com>
Date: Wed, 23 Aug 2017 11:33:47 +0800
Subject: [PATCH 3/4] busybox: support chinese display in terminal
Signed-off-by: hero.huang <hero.huang@rock-chips.com>
---
libbb/printable_string.c | 4 +---
libbb/unicode.c | 4 ++--
2 files changed, 3 insertions(+), 5 deletions(-)
diff --git a/libbb/printable_string.c b/libbb/printable_string.c
index a814fd0..f4c7b00 100644
--- a/libbb/printable_string.c
+++ b/libbb/printable_string.c
@@ -28,8 +28,6 @@ const char* FAST_FUNC printable_string2(uni_stat_t *stats, const char *str)
}
if (c < ' ')
break;
- if (c >= 0x7f)
- break;
s++;
}
@@ -42,7 +40,7 @@ const char* FAST_FUNC printable_string2(uni_stat_t *stats, const char *str)
unsigned char c = *d;
if (c == '\0')
break;
- if (c < ' ' || c >= 0x7f)
+ if (c < ' ')
*d = '?';
d++;
}
diff --git a/libbb/unicode.c b/libbb/unicode.c
index e98cbbf..677db1f 100644
--- a/libbb/unicode.c
+++ b/libbb/unicode.c
@@ -1027,7 +1027,7 @@ static char* FAST_FUNC unicode_conv_to_printable2(uni_stat_t *stats, const char
while ((int)--width >= 0);
break;
}
- *d++ = (c >= ' ' && c < 0x7f) ? c : '?';
+ *d++ = (c >= ' ') ? c : '?';
src++;
}
*d = '\0';
@@ -1035,7 +1035,7 @@ static char* FAST_FUNC unicode_conv_to_printable2(uni_stat_t *stats, const char
d = dst = xstrndup(src, width);
while (*d) {
unsigned char c = *d;
- if (c < ' ' || c >= 0x7f)
+ if (c < ' ')
*d = '?';
d++;
}
--
2.20.1