diff options
author | Ingo Schwarze <schwarze@cvs.openbsd.org> | 2016-10-28 07:23:00 +0000 |
---|---|---|
committer | Ingo Schwarze <schwarze@cvs.openbsd.org> | 2016-10-28 07:23:00 +0000 |
commit | e1eb93081c1a15355b195a51873d6f833e4d6fcc (patch) | |
tree | 0b541d83cf7ca112e060ac73fc158ecf71fccd2d /usr.bin/basename | |
parent | 1b87e303329de4689e89673013329a46d50ee901 (diff) |
Delete some useless setlocale(3) calls in /usr/bin, no functional change.
Patches from Jan Stary <hans at stare dot cz>, tweaked by me and tb@.
While here, apply some simple style improvements:
Sort headers, static void __dead usage(), return from main(),
zap case '?', drop /* NOTREACHED */, drop break after usage(), ...
OK tb@ millert@
Diffstat (limited to 'usr.bin/basename')
-rw-r--r-- | usr.bin/basename/basename.c | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/usr.bin/basename/basename.c b/usr.bin/basename/basename.c index 21f63b0fbef..f2d8c820ee1 100644 --- a/usr.bin/basename/basename.c +++ b/usr.bin/basename/basename.c @@ -1,4 +1,4 @@ -/* $OpenBSD: basename.c,v 1.13 2015/12/24 17:11:47 mmcc Exp $ */ +/* $OpenBSD: basename.c,v 1.14 2016/10/28 07:22:59 schwarze Exp $ */ /* $NetBSD: basename.c,v 1.9 1995/09/02 05:29:46 jtc Exp $ */ /*- @@ -32,13 +32,12 @@ #include <err.h> #include <libgen.h> -#include <locale.h> #include <stdio.h> #include <stdlib.h> #include <string.h> #include <unistd.h> -void usage(void); +static void __dead usage(void); int main(int argc, char *argv[]) @@ -46,8 +45,6 @@ main(int argc, char *argv[]) int ch; char *p; - setlocale(LC_ALL, ""); - if (pledge("stdio", NULL) == -1) err(1, "pledge"); @@ -65,7 +62,7 @@ main(int argc, char *argv[]) if (**argv == '\0') { (void)puts(""); - exit(0); + return 0; } p = basename(*argv); if (p == NULL) @@ -93,7 +90,8 @@ main(int argc, char *argv[]) } extern char *__progname; -void + +static void __dead usage(void) { |