diff options
Diffstat (limited to 'usr.bin/sed/main.c')
-rw-r--r-- | usr.bin/sed/main.c | 37 |
1 files changed, 5 insertions, 32 deletions
diff --git a/usr.bin/sed/main.c b/usr.bin/sed/main.c index cfe9d35..69def8b 100644 --- a/usr.bin/sed/main.c +++ b/usr.bin/sed/main.c @@ -34,25 +34,6 @@ * SUCH DAMAGE. */ -#if HAVE_NBTOOL_CONFIG_H -#include "nbtool_config.h" -#endif - -#include <sys/cdefs.h> -__RCSID("$NetBSD: main.c,v 1.34 2015/03/12 12:40:41 christos Exp $"); -#ifdef __FBSDID -__FBSDID("$FreeBSD: head/usr.bin/sed/main.c 252231 2013-06-26 04:14:19Z pfg $"); -#endif - -#ifndef lint -__COPYRIGHT("@(#) Copyright (c) 1992, 1993\ - The Regents of the University of California. All rights reserved."); -#endif - -#if 0 -static const char sccsid[] = "@(#)main.c 8.2 (Berkeley) 1/3/94"; -#endif - #include <sys/types.h> #include <sys/mman.h> #include <sys/param.h> @@ -69,6 +50,7 @@ static const char sccsid[] = "@(#)main.c 8.2 (Berkeley) 1/3/94"; #define _WITH_GETLINE #include <stdio.h> #include <stdlib.h> +#include <bsd/stdlib.h> #include <string.h> #include <unistd.h> @@ -123,11 +105,11 @@ const char *outfname; /* Output file name */ static char oldfname[PATH_MAX]; /* Old file name (for in-place editing) */ static char tmpfname[PATH_MAX]; /* Temporary file name (for in-place editing) */ static const char *inplace; /* Inplace edit file extension. */ -u_long linenum; +unsigned long linenum; static void add_compunit(enum e_cut, char *); static void add_file(char *); -static void usage(void) __dead; +static void usage(void); int main(int argc, char *argv[]) @@ -148,7 +130,7 @@ main(int argc, char *argv[]) rflags = REG_EXTENDED; break; case 'I': - inplace = optarg ? optarg : __UNCONST(""); + inplace = optarg ? optarg : ""; ispan = 1; /* span across input files */ break; case 'a': @@ -166,15 +148,11 @@ main(int argc, char *argv[]) add_compunit(CU_FILE, optarg); break; case 'i': - inplace = optarg ? optarg : __UNCONST(""); + inplace = optarg ? optarg : ""; ispan = 0; /* don't span across input files */ break; case 'l': -#ifdef _IOLBF c = setvbuf(stdout, NULL, _IOLBF, 0); -#else - c = setlinebuf(stdout); -#endif if (c) warn("setting line buffered output failed"); break; @@ -182,12 +160,7 @@ main(int argc, char *argv[]) nflag = 1; break; case 'u': -#ifdef _IONBF c = setvbuf(stdout, NULL, _IONBF, 0); -#else - c = -1; - errno = EOPNOTSUPP; -#endif if (c) warn("setting unbuffered output failed"); break; |