summaryrefslogtreecommitdiff
path: root/usr.bin/grep
diff options
context:
space:
mode:
authorKiyoshi Aman <kiyoshi.aman+adelie@gmail.com>2019-06-02 05:43:07 -0500
committerKiyoshi Aman <kiyoshi.aman+adelie@gmail.com>2019-06-02 05:43:07 -0500
commit18481510d9e6e3a6fec5e466d179bffe60d3acf8 (patch)
treee6dc941535a2c6c3bc21656bb40d5490239f86c0 /usr.bin/grep
parent09863a10639de265b2299938a292bba15abc570a (diff)
downloaduserland-18481510d9e6e3a6fec5e466d179bffe60d3acf8.tar.gz
userland-18481510d9e6e3a6fec5e466d179bffe60d3acf8.tar.bz2
userland-18481510d9e6e3a6fec5e466d179bffe60d3acf8.tar.xz
userland-18481510d9e6e3a6fec5e466d179bffe60d3acf8.zip
usr.bin/grep: make buildable; needs more hammering to ensure proper functioning
Diffstat (limited to 'usr.bin/grep')
-rw-r--r--usr.bin/grep/fastgrep.c7
-rw-r--r--usr.bin/grep/file.c7
-rw-r--r--usr.bin/grep/grep.c24
-rw-r--r--usr.bin/grep/grep.h7
-rw-r--r--usr.bin/grep/queue.c7
-rw-r--r--usr.bin/grep/util.c7
6 files changed, 2 insertions, 57 deletions
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 <sys/cdefs.h>
-__RCSID("$NetBSD: fastgrep.c,v 1.5 2011/04/18 03:27:40 joerg Exp $");
-
#include <limits.h>
#include <stdbool.h>
#include <stdlib.h>
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 <sys/cdefs.h>
-__RCSID("$NetBSD: file.c,v 1.10 2018/08/12 09:03:21 christos Exp $");
-
#include <sys/param.h>
#include <sys/types.h>
#include <sys/stat.h>
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 <sys/cdefs.h>
-__RCSID("$NetBSD: grep.c,v 1.15 2018/08/12 09:03:21 christos Exp $");
-
#include <sys/stat.h>
#include <sys/types.h>
@@ -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_types.h>
-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 <zlib.h>
#endif
-#ifdef WITHOUT_NLS
#define getstr(n) errstr[n]
-#else
-#include <nl_types.h>
-
-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 <sys/queue.h> to get a better performance.
*/
-#if HAVE_NBTOOL_CONFIG_H
-#include "nbtool_config.h"
-#endif
-
-#include <sys/cdefs.h>
-__RCSID("$NetBSD: queue.c,v 1.5 2011/08/31 16:24:57 plunky Exp $");
-
#include <sys/param.h>
#include <sys/queue.h>
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 <sys/cdefs.h>
-__RCSID("$NetBSD: util.c,v 1.19 2018/02/05 22:14:26 mrg Exp $");
-
#include <sys/stat.h>
#include <sys/types.h>