sort,numfmt: with --debug, diagnose failure to set locale
commitdee6b7601009688cfb931379b47a701f7dd771e3
authorPádraig Brady <P@draigBrady.com>
Tue, 22 Sep 2015 01:07:41 +0000 (22 02:07 +0100)
committerPádraig Brady <P@draigBrady.com>
Tue, 22 Sep 2015 01:30:30 +0000 (22 02:30 +0100)
tree17b00da6f156e1c34a8c35e88d944b39f0d170f3
parentd4a22dff9b4cd8b05cb01e654fa84b189d3b5721
sort,numfmt: with --debug, diagnose failure to set locale

* src/sort.c (main): With --debug, warn upon setlocale() failure,
which can happen due to incorrectly specified environment variables,
or due to memory exhaustion (simulated with ulimit -v), etc.
* tests/misc/sort-debug-warn.sh: Add a test case.
See also http://savannah.gnu.org/bugs/11004
src/numfmt.c
src/sort.c
tests/misc/sort-debug-warn.sh