[augeas-devel] augeas: master - Make augparse and augtool use user's locale
David Lutterkort
lutter at fedoraproject.org
Tue Nov 10 17:24:40 UTC 2009
Gitweb: http://git.fedorahosted.org/git/augeas.git?p=augeas.git;a=commitdiff;h=5b341e15f85aaa641b165cead4428afbf5468d77
Commit: 5b341e15f85aaa641b165cead4428afbf5468d77
Parent: 2c48f9f15da595d59c867188ec697a566088bab2
Author: David Lutterkort <lutter at redhat.com>
AuthorDate: Fri Jan 16 16:36:45 2009 -0800
Committer: David Lutterkort <lutter at redhat.com>
CommitterDate: Tue Nov 10 09:23:40 2009 -0800
Make augparse and augtool use user's locale
---
src/augparse.c | 2 ++
src/augtool.c | 3 +++
2 files changed, 5 insertions(+), 0 deletions(-)
diff --git a/src/augparse.c b/src/augparse.c
index 0fd5c84..012303c 100644
--- a/src/augparse.c
+++ b/src/augparse.c
@@ -27,6 +27,7 @@
#include "list.h"
#include "syntax.h"
#include "augeas.h"
+#include <locale.h>
const char *progname;
bool print_version = false;
@@ -86,6 +87,7 @@ int main(int argc, char **argv) {
unsigned int flags = AUG_TYPE_CHECK|AUG_NO_MODL_AUTOLOAD;
progname = argv[0];
+ setlocale(LC_ALL, "");
while ((opt = getopt_long(argc, argv, "hI:", options, &idx)) != -1) {
switch(opt) {
case 'I':
diff --git a/src/augtool.c b/src/augtool.c
index 21822a2..46d6b09 100644
--- a/src/augtool.c
+++ b/src/augtool.c
@@ -30,6 +30,7 @@
#include <getopt.h>
#include <limits.h>
#include <ctype.h>
+#include <locale.h>
struct command {
const char *name;
@@ -746,6 +747,8 @@ static int main_loop(void) {
int main(int argc, char **argv) {
int r;
+ setlocale(LC_ALL, "");
+
parse_opts(argc, argv);
aug = aug_init(root, loadpath, flags);
More information about the augeas-devel
mailing list