From 18481510d9e6e3a6fec5e466d179bffe60d3acf8 Mon Sep 17 00:00:00 2001 From: Kiyoshi Aman Date: Sun, 2 Jun 2019 05:43:07 -0500 Subject: usr.bin/grep: make buildable; needs more hammering to ensure proper functioning --- usr.bin/grep/fastgrep.c | 7 ------- usr.bin/grep/file.c | 7 ------- usr.bin/grep/grep.c | 24 ++---------------------- usr.bin/grep/grep.h | 7 ------- usr.bin/grep/queue.c | 7 ------- usr.bin/grep/util.c | 7 ------- 6 files changed, 2 insertions(+), 57 deletions(-) (limited to 'usr.bin') diff --git a/usr.bin/grep/fastgrep.c b/usr.bin/grep/fastgrep.c index 2fcd864..dc1de12 100644 --- a/usr.bin/grep/fastgrep.c +++ b/usr.bin/grep/fastgrep.c @@ -35,13 +35,6 @@ * meantime, we need to use this workaround. */ -#if HAVE_NBTOOL_CONFIG_H -#include "nbtool_config.h" -#endif - -#include -__RCSID("$NetBSD: fastgrep.c,v 1.5 2011/04/18 03:27:40 joerg Exp $"); - #include #include #include diff --git a/usr.bin/grep/file.c b/usr.bin/grep/file.c index ef057ba..7a024ec 100644 --- a/usr.bin/grep/file.c +++ b/usr.bin/grep/file.c @@ -30,13 +30,6 @@ * SUCH DAMAGE. */ -#if HAVE_NBTOOL_CONFIG_H -#include "nbtool_config.h" -#endif - -#include -__RCSID("$NetBSD: file.c,v 1.10 2018/08/12 09:03:21 christos Exp $"); - #include #include #include diff --git a/usr.bin/grep/grep.c b/usr.bin/grep/grep.c index bad2a73..4fb4b1b 100644 --- a/usr.bin/grep/grep.c +++ b/usr.bin/grep/grep.c @@ -29,13 +29,6 @@ * SUCH DAMAGE. */ -#if HAVE_NBTOOL_CONFIG_H -#include "nbtool_config.h" -#endif - -#include -__RCSID("$NetBSD: grep.c,v 1.15 2018/08/12 09:03:21 christos Exp $"); - #include #include @@ -54,11 +47,6 @@ __RCSID("$NetBSD: grep.c,v 1.15 2018/08/12 09:03:21 christos Exp $"); #include "grep.h" -#ifndef WITHOUT_NLS -#include -nl_catd catalog; -#endif - /* * Default messags to use when NLS is disabled or no catalogue * is found. @@ -78,7 +66,7 @@ const char *errstr[] = { /* Flags passed to regcomp() and regexec() */ int cflags = 0; -int eflags = REG_STARTEND; +int eflags = REG_NOTBOL | REG_NOTEOL; /* Searching patterns */ unsigned int patterns, pattern_sz; @@ -154,7 +142,7 @@ extern char *__progname; /* * Prints usage information and returns 2. */ -__dead static void +static void usage(void) { fprintf(stderr, getstr(4), __progname); @@ -325,10 +313,6 @@ main(int argc, char *argv[]) setlocale(LC_ALL, ""); -#ifndef WITHOUT_NLS - catalog = catopen("grep", NL_CAT_LOCALE); -#endif - /* Check what is the program name of the binary. In this way we can have all the funcionalities in one binary without the need of scripting and using ugly hacks. */ @@ -712,10 +696,6 @@ main(int argc, char *argv[]) c+= procfile(*aargv); } -#ifndef WITHOUT_NLS - catclose(catalog); -#endif - /* Find out the correct return value according to the results and the command line option. */ exit(c ? (notfound ? (qflag ? 0 : 2) : 0) : (notfound ? 2 : 1)); diff --git a/usr.bin/grep/grep.h b/usr.bin/grep/grep.h index b7ef7fa..7d50c61 100644 --- a/usr.bin/grep/grep.h +++ b/usr.bin/grep/grep.h @@ -40,14 +40,7 @@ #include #endif -#ifdef WITHOUT_NLS #define getstr(n) errstr[n] -#else -#include - -extern nl_catd catalog; -#define getstr(n) catgets(catalog, 1, n, errstr[n]) -#endif extern const char *errstr[]; diff --git a/usr.bin/grep/queue.c b/usr.bin/grep/queue.c index e3c6be1..fa7a95d 100644 --- a/usr.bin/grep/queue.c +++ b/usr.bin/grep/queue.c @@ -31,13 +31,6 @@ * Dodge. It is used in place of to get a better performance. */ -#if HAVE_NBTOOL_CONFIG_H -#include "nbtool_config.h" -#endif - -#include -__RCSID("$NetBSD: queue.c,v 1.5 2011/08/31 16:24:57 plunky Exp $"); - #include #include diff --git a/usr.bin/grep/util.c b/usr.bin/grep/util.c index a3c9e4c..99e3942 100644 --- a/usr.bin/grep/util.c +++ b/usr.bin/grep/util.c @@ -29,13 +29,6 @@ * SUCH DAMAGE. */ -#if HAVE_NBTOOL_CONFIG_H -#include "nbtool_config.h" -#endif - -#include -__RCSID("$NetBSD: util.c,v 1.19 2018/02/05 22:14:26 mrg Exp $"); - #include #include -- cgit v1.2.3-60-g2f50