summaryrefslogtreecommitdiff
path: root/bin/cp/cp.c
diff options
context:
space:
mode:
authorEric Jackson <ericj@cvs.openbsd.org>2000-02-20 23:03:56 +0000
committerEric Jackson <ericj@cvs.openbsd.org>2000-02-20 23:03:56 +0000
commit6b5c4a38b6b71e5a3499877f195804ebb112edac (patch)
tree65e4070050e2d2b3065bb91ae344079e8b0441bd /bin/cp/cp.c
parent9b375f42f0a79ca2284f7a0c008ff7db861f63cf (diff)
setlocale and get rid of unneeded exit() call. millert@ ok
Diffstat (limited to 'bin/cp/cp.c')
-rw-r--r--bin/cp/cp.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/bin/cp/cp.c b/bin/cp/cp.c
index 66358812598..ac34803ece6 100644
--- a/bin/cp/cp.c
+++ b/bin/cp/cp.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: cp.c,v 1.13 1999/05/06 17:19:45 millert Exp $ */
+/* $OpenBSD: cp.c,v 1.14 2000/02/20 23:03:55 ericj Exp $ */
/* $NetBSD: cp.c,v 1.14 1995/09/07 06:14:51 jtc Exp $ */
/*
@@ -47,7 +47,7 @@ static char copyright[] =
#if 0
static char sccsid[] = "@(#)cp.c 8.5 (Berkeley) 4/29/95";
#else
-static char rcsid[] = "$OpenBSD: cp.c,v 1.13 1999/05/06 17:19:45 millert Exp $";
+static char rcsid[] = "$OpenBSD: cp.c,v 1.14 2000/02/20 23:03:55 ericj Exp $";
#endif
#endif /* not lint */
@@ -76,6 +76,7 @@ static char rcsid[] = "$OpenBSD: cp.c,v 1.13 1999/05/06 17:19:45 millert Exp $";
#include <errno.h>
#include <fcntl.h>
#include <fts.h>
+#include <locale.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
@@ -110,6 +111,8 @@ main(argc, argv)
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) {
@@ -217,10 +220,8 @@ main(argc, argv)
/*
* Case (1). Target is not a directory.
*/
- if (argc > 1) {
+ if (argc > 1)
usage();
- exit(1);
- }
/*
* Need to detect the case:
* cp -R dir foo