termux-packages/packages/psmisc/pstree.patch

36 lines
929 B
Diff

Default to UTF-8 - may be overridden by command line flags.
diff -u -r ../psmisc-22.21/src/pstree.c ./src/pstree.c
--- ../psmisc-22.21/src/pstree.c 2014-02-02 06:59:07.000000000 +0100
+++ ./src/pstree.c 2014-06-30 18:35:12.064021186 +0200
@@ -36,7 +36,9 @@
#include <curses.h>
#include <term.h>
#include <termios.h>
-#include <langinfo.h>
+#ifndef __ANDROID__
+# include <langinfo.h>
+#endif
#include <assert.h>
#include <sys/types.h>
#include <sys/stat.h>
@@ -1087,6 +1089,10 @@
* command-line options, if given.
*/
+#ifdef __ANDROID__
+ /* Droids love unicode */
+ sym = &sym_utf;
+#else
if (isatty(1) && !strcmp(nl_langinfo(CODESET), "UTF-8")) {
/* Use UTF-8 symbols if the locale's character set is UTF-8. */
sym = &sym_utf;
@@ -1106,6 +1112,7 @@
/* Otherwise, fall back to ASCII. */
sym = &sym_ascii;
}
+#endif
#ifdef WITH_SELINUX
while ((c =