Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/bin/cp Initialize locale on startup.



details:   https://anonhg.NetBSD.org/src/rev/cd439106c1f3
branches:  trunk
changeset: 476093:cd439106c1f3
user:      kleink <kleink%NetBSD.org@localhost>
date:      Sun Sep 05 16:14:43 1999 +0000

description:
Initialize locale on startup.

diffstat:

 bin/cp/cp.c |  7 +++++--
 1 files changed, 5 insertions(+), 2 deletions(-)

diffs (35 lines):

diff -r ae0ffbe5d5ef -r cd439106c1f3 bin/cp/cp.c
--- a/bin/cp/cp.c       Sun Sep 05 15:11:42 1999 +0000
+++ b/bin/cp/cp.c       Sun Sep 05 16:14:43 1999 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: cp.c,v 1.27 1999/03/01 18:57:29 mjl Exp $      */
+/*     $NetBSD: cp.c,v 1.28 1999/09/05 16:14:43 kleink Exp $   */
 
 /*
  * Copyright (c) 1988, 1993, 1994
@@ -47,7 +47,7 @@
 #if 0
 static char sccsid[] = "@(#)cp.c       8.5 (Berkeley) 4/29/95";
 #else
-__RCSID("$NetBSD: cp.c,v 1.27 1999/03/01 18:57:29 mjl Exp $");
+__RCSID("$NetBSD: cp.c,v 1.28 1999/09/05 16:14:43 kleink Exp $");
 #endif
 #endif /* not lint */
 
@@ -72,6 +72,7 @@
 #include <err.h>
 #include <errno.h>
 #include <fts.h>
+#include <locale.h>
 #include <stdio.h>
 #include <string.h>
 #include <unistd.h>
@@ -105,6 +106,8 @@
        int Hflag, Lflag, Pflag, ch, fts_options, r;
        char *target;
 
+       (void)setlocale(LC_ALL, "");
+
        Hflag = Lflag = Pflag = Rflag = 0;
        while ((ch = getopt(argc, argv, "HLPRfipr")) != -1) 
                switch (ch) {



Home | Main Index | Thread Index | Old Index