]> granicus.if.org Git - procps-ng/commitdiff
escape.c: Fix missing nl_langinfo on certain configs
authorIssam E. Maghni <issam.e.maghni@mailbox.org>
Sat, 24 Apr 2021 01:46:48 +0000 (11:46 +1000)
committerCraig Small <csmall@dropbear.xyz>
Sat, 24 Apr 2021 01:46:48 +0000 (11:46 +1000)
nl_langinfo and CODESET are undefined in a musl system. Instead of
uncondionally including langinfo.h, this change includes include/nls.h
which has the tests and work-arounds for systems that don't have these
features. This is similar to how other programs within procps include
langinfo.h via nls.h

References:
 procps-ng/procps!130

Signed-off-by: Craig Small <csmall@dropbear.xyz>
proc/escape.c

index 32961a3b04b8caf19ca9013a842b88e685c78c81..6c903a3216787cd69804982e1f873039a86d4018 100644 (file)
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
  */
 
-#include <langinfo.h>
 #include <limits.h>
 #include <stdio.h>
 #include <string.h>
 
 #include "escape.h"
 #include "readproc.h"
+#include "nls.h"
 
 #define SECURE_ESCAPE_ARGS(dst, bytes) do { \
   if ((bytes) <= 0) return 0; \