It seems that xargs(1) sets LC_MESSAGE in case someone would like
to give a 'y' response to xargs -p in their native tongue.
Is that so, and is that intended?

I never new locale(1) is also supposed to specify
what "an affirmative response, ‘y’ in the POSIX locale" is,
as the current manpage puts it.

        Jan



Index: xargs.1
===================================================================
RCS file: /cvs/src/usr.bin/xargs/xargs.1,v
retrieving revision 1.28
diff -u -p -r1.28 xargs.1
--- xargs.1     4 Jun 2014 06:48:33 -0000       1.28
+++ xargs.1     3 Nov 2017 16:32:35 -0000
@@ -213,9 +213,8 @@ at once.
 .It Fl p
 Echo each command to be executed and ask the user whether it should be
 executed.
-An affirmative response,
+An affirmative response of
 .Ql y
-in the POSIX locale,
 causes the command to be executed, any other response causes it to be
 skipped.
 No commands are executed if the process is not attached to a terminal.
Index: xargs.c
===================================================================
RCS file: /cvs/src/usr.bin/xargs/xargs.c,v
retrieving revision 1.33
diff -u -p -r1.33 xargs.c
--- xargs.c     16 Oct 2017 13:10:50 -0000      1.33
+++ xargs.c     3 Nov 2017 16:32:35 -0000
@@ -42,7 +42,6 @@
 #include <errno.h>
 #include <fcntl.h>
 #include <langinfo.h>
-#include <locale.h>
 #include <paths.h>
 #include <regex.h>
 #include <signal.h>
@@ -85,8 +84,6 @@ main(int argc, char *argv[])
        ep = environ;
        eofstr = "";
        Jflag = nflag = 0;
-
-       (void)setlocale(LC_MESSAGES, "");
 
        /*
         * POSIX.2 limits the exec line length to ARG_MAX - 2K.  Running that

Reply via email to