aboutsummaryrefslogtreecommitdiff
path: root/lib/libdpv
diff options
context:
space:
mode:
authorDevin Teske <dteske@FreeBSD.org>2016-01-14 01:59:20 +0000
committerDevin Teske <dteske@FreeBSD.org>2016-01-14 01:59:20 +0000
commit9e35cfced589bcba4de1f0b9e92042099083a36a (patch)
tree25ed481da48230bc7bb42fba91b211f9e1d01ce7 /lib/libdpv
parent414dbbaf56c7dd3fc6a90ff94730bcd672e00c6e (diff)
downloadsrc-9e35cfced589bcba4de1f0b9e92042099083a36a.tar.gz
src-9e35cfced589bcba4de1f0b9e92042099083a36a.zip
Default to en_US.ISO8859-1 if no locale
MFC after: 3 days X-MFC-to: stable/10
Notes
Notes: svn path=/head/; revision=293868
Diffstat (limited to 'lib/libdpv')
-rw-r--r--lib/libdpv/dpv.c6
-rw-r--r--lib/libdpv/dpv.h3
2 files changed, 9 insertions, 0 deletions
diff --git a/lib/libdpv/dpv.c b/lib/libdpv/dpv.c
index 6a03922ff9fd..d3506ca9d82d 100644
--- a/lib/libdpv/dpv.c
+++ b/lib/libdpv/dpv.c
@@ -36,6 +36,7 @@ __FBSDID("$FreeBSD$");
#include <dialog.h>
#include <err.h>
#include <limits.h>
+#include <locale.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
@@ -482,6 +483,11 @@ dpv(struct dpv_config *config, struct dpv_file_node *file_list)
/* Reads: label_size pbar_size pprompt aprompt dpv_nfiles */
/* Inits: dheight and dwidth */
+ /* Default localeconv(3) settings for dialog(3) status */
+ setlocale(LC_NUMERIC,
+ getenv("LC_ALL") == NULL && getenv("LC_NUMERIC") == NULL ?
+ LC_NUMERIC_DEFAULT : "");
+
if (!debug) {
/* Internally create the initial `--gauge' prompt text */
dprompt_recreate(file_list, (struct dpv_file_node *)NULL, 0);
diff --git a/lib/libdpv/dpv.h b/lib/libdpv/dpv.h
index dbcd59bd67c0..03768a7ced40 100644
--- a/lib/libdpv/dpv.h
+++ b/lib/libdpv/dpv.h
@@ -38,6 +38,9 @@
#define FALSE 0
#endif
+/* localeconv(3) */
+#define LC_NUMERIC_DEFAULT "en_US.ISO8859-1"
+
/* Data to process */
extern long long dpv_overall_read;