Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 27 Jan 2016 06:25:59 +0000 (UTC)
From:      Devin Teske <dteske@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org
Subject:   svn commit: r294895 - stable/10/lib/libdpv
Message-ID:  <201601270625.u0R6PxVq033310@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: dteske
Date: Wed Jan 27 06:25:59 2016
New Revision: 294895
URL: https://svnweb.freebsd.org/changeset/base/294895

Log:
  MFC r293868: Default to en_US.ISO8859-1 if no locale

Modified:
  stable/10/lib/libdpv/dpv.c
  stable/10/lib/libdpv/dpv.h
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/lib/libdpv/dpv.c
==============================================================================
--- stable/10/lib/libdpv/dpv.c	Wed Jan 27 06:24:19 2016	(r294894)
+++ stable/10/lib/libdpv/dpv.c	Wed Jan 27 06:25:59 2016	(r294895)
@@ -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 dp
 		/* 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);

Modified: stable/10/lib/libdpv/dpv.h
==============================================================================
--- stable/10/lib/libdpv/dpv.h	Wed Jan 27 06:24:19 2016	(r294894)
+++ stable/10/lib/libdpv/dpv.h	Wed Jan 27 06:25:59 2016	(r294895)
@@ -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;
 



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201601270625.u0R6PxVq033310>