From fdf3aa0295fd6d0748cda6f97ab57852fba8051e Mon Sep 17 00:00:00 2001 From: dteske Date: Wed, 27 Jan 2016 06:25:59 +0000 Subject: MFC r293868: Default to en_US.ISO8859-1 if no locale --- lib/libdpv/dpv.c | 6 ++++++ lib/libdpv/dpv.h | 3 +++ 2 files changed, 9 insertions(+) (limited to 'lib') diff --git a/lib/libdpv/dpv.c b/lib/libdpv/dpv.c index 6a03922..d3506ca 100644 --- a/lib/libdpv/dpv.c +++ b/lib/libdpv/dpv.c @@ -36,6 +36,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -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 dbcd59b..03768a7 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; -- cgit v1.1