Sat Oct 15 21:53:22 2022 UTC ()
fix various typos in documentation and comments.
mainly in words functionality, functional, function.


(andvar)
diff -r1.1 -r1.2 src/sbin/blkdiscard/blkdiscard.8
diff -r1.3 -r1.4 src/share/man/man3lua/syslog.3lua
diff -r1.16 -r1.17 src/sys/arch/shark/shark/sequoia.c
diff -r1.25 -r1.26 src/sys/netinet/sctp_pcb.c
diff -r1.15 -r1.16 src/usr.bin/grep/grep.c

cvs diff -r1.1 -r1.2 src/sbin/blkdiscard/blkdiscard.8 (expand / switch to unified diff)

--- src/sbin/blkdiscard/blkdiscard.8 2022/02/07 09:33:26 1.1
+++ src/sbin/blkdiscard/blkdiscard.8 2022/10/15 21:53:21 1.2
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1.\" $NetBSD: blkdiscard.8,v 1.1 2022/02/07 09:33:26 mrg Exp $ 1.\" $NetBSD: blkdiscard.8,v 1.2 2022/10/15 21:53:21 andvar Exp $
2.\" 2.\"
3.\" Copyright (c) 2022 Matthew R. Green 3.\" Copyright (c) 2022 Matthew R. Green
4.\" All rights reserved. 4.\" All rights reserved.
5.\" 5.\"
6.\" Redistribution and use in source and binary forms, with or without 6.\" Redistribution and use in source and binary forms, with or without
7.\" modification, are permitted provided that the following conditions 7.\" modification, are permitted provided that the following conditions
8.\" are met: 8.\" are met:
9.\" 1. Redistributions of source code must retain the above copyright 9.\" 1. Redistributions of source code must retain the above copyright
10.\" notice, this list of conditions and the following disclaimer. 10.\" notice, this list of conditions and the following disclaimer.
11.\" 2. Redistributions in binary form must reproduce the above copyright 11.\" 2. Redistributions in binary form must reproduce the above copyright
12.\" notice, this list of conditions and the following disclaimer in the 12.\" notice, this list of conditions and the following disclaimer in the
13.\" documentation and/or other materials provided with the distribution. 13.\" documentation and/or other materials provided with the distribution.
14.\" 14.\"
@@ -148,16 +148,16 @@ command first appeared linux-util. @@ -148,16 +148,16 @@ command first appeared linux-util.
148This implementation was originally called fdiscard-stuff and has been 148This implementation was originally called fdiscard-stuff and has been
149converted to be 149converted to be
150.Lx 150.Lx
151.Xr blkdiscard 8 151.Xr blkdiscard 8
152compatible and appeared in 152compatible and appeared in
153.Nx 10.0 . 153.Nx 10.0 .
154.Sh AUTHORS 154.Sh AUTHORS
155The 155The
156.Nm 156.Nm
157command was written by 157command was written by
158.An Matthew R. Green 158.An Matthew R. Green
159.Aq mrg@eterna.com.au . 159.Aq mrg@eterna.com.au .
160.Sh BUGS 160.Sh BUGS
161The secure erase funtionality of the 161The secure erase functionality of the
162.Fl s 162.Fl s
163option is not yet implemented. 163option is not yet implemented.

cvs diff -r1.3 -r1.4 src/share/man/man3lua/syslog.3lua (expand / switch to unified diff)

--- src/share/man/man3lua/syslog.3lua 2014/01/07 21:54:17 1.3
+++ src/share/man/man3lua/syslog.3lua 2022/10/15 21:53:21 1.4
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1.\" $NetBSD: syslog.3lua,v 1.3 2014/01/07 21:54:17 mbalmer Exp $ 1.\" $NetBSD: syslog.3lua,v 1.4 2022/10/15 21:53:21 andvar Exp $
2.\" 2.\"
3.\" Copyright (c) 2013, 2014 Marc Balmer <mbalmer@NetBSD.org>. 3.\" Copyright (c) 2013, 2014 Marc Balmer <mbalmer@NetBSD.org>.
4.\" All rights reserved. 4.\" All rights reserved.
5.\" 5.\"
6.\" Redistribution and use in source and binary forms, with or without 6.\" Redistribution and use in source and binary forms, with or without
7.\" modification, are permitted provided that the following conditions 7.\" modification, are permitted provided that the following conditions
8.\" are met: 8.\" are met:
9.\" 1. Redistributions of source code must retain the above copyright 9.\" 1. Redistributions of source code must retain the above copyright
10.\" notice, this list of conditions and the following disclaimer. 10.\" notice, this list of conditions and the following disclaimer.
11.\" 2. Redistributions in binary form must reproduce the above copyright 11.\" 2. Redistributions in binary form must reproduce the above copyright
12.\" notice, this list of conditions and the following disclaimer in the 12.\" notice, this list of conditions and the following disclaimer in the
13.\" documentation and/or other materials provided with the distribution. 13.\" documentation and/or other materials provided with the distribution.
14.\" 3. Neither the name of the University nor the names of its contributors 14.\" 3. Neither the name of the University nor the names of its contributors
@@ -40,27 +40,27 @@ functionality from Lua @@ -40,27 +40,27 @@ functionality from Lua
40.Cd "local syslog = require 'syslog'" 40.Cd "local syslog = require 'syslog'"
41.Pp 41.Pp
42.Bl -tag -width XXXX -compact 42.Bl -tag -width XXXX -compact
43.It Dv syslog.openlog(ident, logopt, facility) 43.It Dv syslog.openlog(ident, logopt, facility)
44.It Dv syslog.syslog(priority, message) 44.It Dv syslog.syslog(priority, message)
45.It Dv syslog.closelog() 45.It Dv syslog.closelog()
46.It Dv oldmask = syslog.setlogmask(maskpri) 46.It Dv oldmask = syslog.setlogmask(maskpri)
47.El 47.El
48.Sh DESCRIPTION 48.Sh DESCRIPTION
49The 49The
50.Nm 50.Nm
51Lua binding provides access to the 51Lua binding provides access to the
52.Xr syslog 3 52.Xr syslog 3
53funcionality. 53functionality.
54.Pp 54.Pp
55.Bl -tag -width XXXX -compact 55.Bl -tag -width XXXX -compact
56.Pp 56.Pp
57.It Dv syslog.openlog(ident, logopt, facility) 57.It Dv syslog.openlog(ident, logopt, facility)
58The syslog.openlog() function provides for more specialized processing of the 58The syslog.openlog() function provides for more specialized processing of the
59messages sent by syslog.syslog(). 59messages sent by syslog.syslog().
60The parameter 60The parameter
61.Ar ident 61.Ar ident
62is a string that will be prepended to every message. 62is a string that will be prepended to every message.
63The 63The
64.Ar logopt 64.Ar logopt
65argument is a bit field specifying logging options, which is formed 65argument is a bit field specifying logging options, which is formed
66by adding one or more of the following values: 66by adding one or more of the following values:

cvs diff -r1.16 -r1.17 src/sys/arch/shark/shark/sequoia.c (expand / switch to unified diff)

--- src/sys/arch/shark/shark/sequoia.c 2021/08/07 16:19:05 1.16
+++ src/sys/arch/shark/shark/sequoia.c 2022/10/15 21:53:21 1.17
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: sequoia.c,v 1.16 2021/08/07 16:19:05 thorpej Exp $ */ 1/* $NetBSD: sequoia.c,v 1.17 2022/10/15 21:53:21 andvar Exp $ */
2 2
3/* 3/*
4 * Copyright 1997 4 * Copyright 1997
5 * Digital Equipment Corporation. All rights reserved. 5 * Digital Equipment Corporation. All rights reserved.
6 * 6 *
7 * This software is furnished under license and may be used and 7 * This software is furnished under license and may be used and
8 * copied only in accordance with the following terms and conditions. 8 * copied only in accordance with the following terms and conditions.
9 * Subject to these conditions, you may download, copy, install, 9 * Subject to these conditions, you may download, copy, install,
10 * use, modify and distribute this software in source and/or binary 10 * use, modify and distribute this software in source and/or binary
11 * form. No title or ownership is transferred hereby. 11 * form. No title or ownership is transferred hereby.
12 * 12 *
13 * 1) Any source code used, modified or distributed must reproduce 13 * 1) Any source code used, modified or distributed must reproduce
14 * and retain this copyright notice and list of conditions as 14 * and retain this copyright notice and list of conditions as
@@ -30,27 +30,27 @@ @@ -30,27 +30,27 @@
30 * incidental damages or damages for lost profits, loss of 30 * incidental damages or damages for lost profits, loss of
31 * revenue or loss of use, whether such damages arise in contract, 31 * revenue or loss of use, whether such damages arise in contract,
32 * negligence, tort, under statute, in equity, at law or otherwise, 32 * negligence, tort, under statute, in equity, at law or otherwise,
33 * even if advised of the possibility of such damage. 33 * even if advised of the possibility of such damage.
34 */ 34 */
35 35
36/* 36/*
37** 37**
38** INCLUDE FILES 38** INCLUDE FILES
39** 39**
40*/ 40*/
41 41
42#include <sys/cdefs.h> 42#include <sys/cdefs.h>
43__KERNEL_RCSID(0, "$NetBSD: sequoia.c,v 1.16 2021/08/07 16:19:05 thorpej Exp $"); 43__KERNEL_RCSID(0, "$NetBSD: sequoia.c,v 1.17 2022/10/15 21:53:21 andvar Exp $");
44 44
45#include <sys/param.h> 45#include <sys/param.h>
46#include <sys/systm.h> 46#include <sys/systm.h>
47#include <sys/callout.h> 47#include <sys/callout.h>
48#include <sys/device.h> 48#include <sys/device.h>
49#include <sys/syslog.h> 49#include <sys/syslog.h>
50#include <sys/types.h> 50#include <sys/types.h>
51#include <sys/bus.h> 51#include <sys/bus.h>
52#include <sys/time.h> 52#include <sys/time.h>
53#include <sys/kernel.h> 53#include <sys/kernel.h>
54 54
55#include <dev/isa/isareg.h> 55#include <dev/isa/isareg.h>
56#include <dev/ofisa/ofisavar.h> 56#include <dev/ofisa/ofisavar.h>
@@ -131,35 +131,35 @@ static bus_space_handle_t sequoia_ioh; @@ -131,35 +131,35 @@ static bus_space_handle_t sequoia_ioh;
131 131
132static struct timeval ledLastActive; /* last time we get net activity */ 132static struct timeval ledLastActive; /* last time we get net activity */
133static int ledColor; /* present color of led */ 133static int ledColor; /* present color of led */
134static int ledBlockCount; /* reference count of block calles */  134static int ledBlockCount; /* reference count of block calles */
135int sequoia_index_cache = -1; /* set to silly value so that we dont cache on init */ 135int sequoia_index_cache = -1; /* set to silly value so that we dont cache on init */
136 136
137static callout_t led_timo_ch; 137static callout_t led_timo_ch;
138 138
139static u_int sequoiaLock_savedints; 139static u_int sequoiaLock_savedints;
140static bool sequoiaLock_held; 140static bool sequoiaLock_held;
141 141
142/* 142/*
143** 143**
144** FUNCITONAL PROTOTYPES 144** FUNCTIONAL PROTOTYPES
145** 145**
146*/ 146*/
147static void ledSetBiled(int color); 147static void ledSetBiled(int color);
148static void ledTimeout(void *arg); 148static void ledTimeout(void *arg);
149 149
150/* 150/*
151**  151**
152** FUNCITONS 152** FUNCTIONS
153** 153**
154*/ 154*/
155void sequoiaInit(void) 155void sequoiaInit(void)
156{ 156{
157 u_int16_t seqReg; 157 u_int16_t seqReg;
158 158
159 /* map the sequoia registers */ 159 /* map the sequoia registers */
160 if (bus_space_map(&isa_io_bs_tag, SEQUOIA_BASE, SEQUOIA_NPORTS, 0, &sequoia_ioh)) 160 if (bus_space_map(&isa_io_bs_tag, SEQUOIA_BASE, SEQUOIA_NPORTS, 0, &sequoia_ioh))
161 { 161 {
162 panic("SequoiaInit: io mapping failed"); 162 panic("SequoiaInit: io mapping failed");
163 } 163 }
164 164
165 sequoiaLock(); 165 sequoiaLock();

cvs diff -r1.25 -r1.26 src/sys/netinet/sctp_pcb.c (expand / switch to unified diff)

--- src/sys/netinet/sctp_pcb.c 2022/05/28 22:16:44 1.25
+++ src/sys/netinet/sctp_pcb.c 2022/10/15 21:53:21 1.26
@@ -1,15 +1,15 @@ @@ -1,15 +1,15 @@
1/* $KAME: sctp_pcb.c,v 1.39 2005/06/16 18:29:25 jinmei Exp $ */ 1/* $KAME: sctp_pcb.c,v 1.39 2005/06/16 18:29:25 jinmei Exp $ */
2/* $NetBSD: sctp_pcb.c,v 1.25 2022/05/28 22:16:44 andvar Exp $ */ 2/* $NetBSD: sctp_pcb.c,v 1.26 2022/10/15 21:53:21 andvar Exp $ */
3 3
4/* 4/*
5 * Copyright (c) 2001, 2002, 2003, 2004 Cisco Systems, Inc. 5 * Copyright (c) 2001, 2002, 2003, 2004 Cisco Systems, Inc.
6 * All rights reserved. 6 * All rights reserved.
7 * 7 *
8 * Redistribution and use in source and binary forms, with or without 8 * Redistribution and use in source and binary forms, with or without
9 * modification, are permitted provided that the following conditions 9 * modification, are permitted provided that the following conditions
10 * are met: 10 * are met:
11 * 1. Redistributions of source code must retain the above copyright 11 * 1. Redistributions of source code must retain the above copyright
12 * notice, this list of conditions and the following disclaimer. 12 * notice, this list of conditions and the following disclaimer.
13 * 2. Redistributions in binary form must reproduce the above copyright 13 * 2. Redistributions in binary form must reproduce the above copyright
14 * notice, this list of conditions and the following disclaimer in the 14 * notice, this list of conditions and the following disclaimer in the
15 * documentation and/or other materials provided with the distribution. 15 * documentation and/or other materials provided with the distribution.
@@ -23,27 +23,27 @@ @@ -23,27 +23,27 @@
23 * THIS SOFTWARE IS PROVIDED BY CISCO SYSTEMS AND CONTRIBUTORS ``AS IS'' AND 23 * THIS SOFTWARE IS PROVIDED BY CISCO SYSTEMS AND CONTRIBUTORS ``AS IS'' AND
24 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 24 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
25 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 25 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
26 * ARE DISCLAIMED. IN NO EVENT SHALL CISCO SYSTEMS OR CONTRIBUTORS BE LIABLE 26 * ARE DISCLAIMED. IN NO EVENT SHALL CISCO SYSTEMS OR CONTRIBUTORS BE LIABLE
27 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 27 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
28 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 28 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
29 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 29 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
30 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 30 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
31 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 31 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
32 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 32 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
33 * SUCH DAMAGE. 33 * SUCH DAMAGE.
34 */ 34 */
35#include <sys/cdefs.h> 35#include <sys/cdefs.h>
36__KERNEL_RCSID(0, "$NetBSD: sctp_pcb.c,v 1.25 2022/05/28 22:16:44 andvar Exp $"); 36__KERNEL_RCSID(0, "$NetBSD: sctp_pcb.c,v 1.26 2022/10/15 21:53:21 andvar Exp $");
37 37
38#ifdef _KERNEL_OPT 38#ifdef _KERNEL_OPT
39#include "opt_inet.h" 39#include "opt_inet.h"
40#include "opt_ipsec.h" 40#include "opt_ipsec.h"
41#include "opt_sctp.h" 41#include "opt_sctp.h"
42#endif /* _KERNEL_OPT */ 42#endif /* _KERNEL_OPT */
43 43
44#include <sys/param.h> 44#include <sys/param.h>
45#include <sys/systm.h> 45#include <sys/systm.h>
46#include <sys/malloc.h> 46#include <sys/malloc.h>
47#include <sys/mbuf.h> 47#include <sys/mbuf.h>
48#include <sys/domain.h> 48#include <sys/domain.h>
49#include <sys/protosw.h> 49#include <sys/protosw.h>
@@ -3777,27 +3777,27 @@ static int sctp_scale_up_for_address = S @@ -3777,27 +3777,27 @@ static int sctp_scale_up_for_address = S
3777#ifndef SCTP_TCBHASHSIZE 3777#ifndef SCTP_TCBHASHSIZE
3778#define SCTP_TCBHASHSIZE 1024 3778#define SCTP_TCBHASHSIZE 1024
3779#endif 3779#endif
3780 3780
3781#ifndef SCTP_CHUNKQUEUE_SCALE 3781#ifndef SCTP_CHUNKQUEUE_SCALE
3782#define SCTP_CHUNKQUEUE_SCALE 10 3782#define SCTP_CHUNKQUEUE_SCALE 10
3783#endif 3783#endif
3784 3784
3785void 3785void
3786sctp_pcb_init(void) 3786sctp_pcb_init(void)
3787{ 3787{
3788 /* 3788 /*
3789 * SCTP initialization for the PCB structures 3789 * SCTP initialization for the PCB structures
3790 * should be called by the sctp_init() funciton. 3790 * should be called by the sctp_init() function.
3791 */ 3791 */
3792 int i; 3792 int i;
3793 int hashtblsize = SCTP_TCBHASHSIZE; 3793 int hashtblsize = SCTP_TCBHASHSIZE;
3794 3794
3795#if defined(__FreeBSD__) || defined(__APPLE__) 3795#if defined(__FreeBSD__) || defined(__APPLE__)
3796 int sctp_chunkscale = SCTP_CHUNKQUEUE_SCALE; 3796 int sctp_chunkscale = SCTP_CHUNKQUEUE_SCALE;
3797#endif 3797#endif
3798 3798
3799 if (sctp_pcb_initialized != 0) { 3799 if (sctp_pcb_initialized != 0) {
3800 /* error I was called twice */ 3800 /* error I was called twice */
3801 return; 3801 return;
3802 } 3802 }
3803 sctp_pcb_initialized = 1; 3803 sctp_pcb_initialized = 1;

cvs diff -r1.15 -r1.16 src/usr.bin/grep/grep.c (expand / switch to unified diff)

--- src/usr.bin/grep/grep.c 2018/08/12 09:03:21 1.15
+++ src/usr.bin/grep/grep.c 2022/10/15 21:53:22 1.16
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: grep.c,v 1.15 2018/08/12 09:03:21 christos Exp $ */ 1/* $NetBSD: grep.c,v 1.16 2022/10/15 21:53:22 andvar Exp $ */
2/* $FreeBSD: head/usr.bin/grep/grep.c 211519 2010-08-19 22:55:17Z delphij $ */ 2/* $FreeBSD: head/usr.bin/grep/grep.c 211519 2010-08-19 22:55:17Z delphij $ */
3/* $OpenBSD: grep.c,v 1.42 2010/07/02 22:18:03 tedu Exp $ */ 3/* $OpenBSD: grep.c,v 1.42 2010/07/02 22:18:03 tedu Exp $ */
4 4
5/*- 5/*-
6 * Copyright (c) 1999 James Howard and Dag-Erling Coïdan Smørgrav 6 * Copyright (c) 1999 James Howard and Dag-Erling Coïdan Smørgrav
7 * Copyright (C) 2008-2009 Gabor Kovesdan <gabor@FreeBSD.org> 7 * Copyright (C) 2008-2009 Gabor Kovesdan <gabor@FreeBSD.org>
8 * All rights reserved. 8 * All rights reserved.
9 * 9 *
10 * Redistribution and use in source and binary forms, with or without 10 * Redistribution and use in source and binary forms, with or without
11 * modification, are permitted provided that the following conditions 11 * modification, are permitted provided that the following conditions
12 * are met: 12 * are met:
13 * 1. Redistributions of source code must retain the above copyright 13 * 1. Redistributions of source code must retain the above copyright
14 * notice, this list of conditions and the following disclaimer. 14 * notice, this list of conditions and the following disclaimer.
@@ -24,53 +24,53 @@ @@ -24,53 +24,53 @@
24 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 24 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
25 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 25 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
26 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 26 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
27 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 27 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
28 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 28 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
29 * SUCH DAMAGE. 29 * SUCH DAMAGE.
30 */ 30 */
31 31
32#if HAVE_NBTOOL_CONFIG_H 32#if HAVE_NBTOOL_CONFIG_H
33#include "nbtool_config.h" 33#include "nbtool_config.h"
34#endif 34#endif
35 35
36#include <sys/cdefs.h> 36#include <sys/cdefs.h>
37__RCSID("$NetBSD: grep.c,v 1.15 2018/08/12 09:03:21 christos Exp $"); 37__RCSID("$NetBSD: grep.c,v 1.16 2022/10/15 21:53:22 andvar Exp $");
38 38
39#include <sys/stat.h> 39#include <sys/stat.h>
40#include <sys/types.h> 40#include <sys/types.h>
41 41
42#include <ctype.h> 42#include <ctype.h>
43#include <err.h> 43#include <err.h>
44#include <errno.h> 44#include <errno.h>
45#include <getopt.h> 45#include <getopt.h>
46#include <limits.h> 46#include <limits.h>
47#include <libgen.h> 47#include <libgen.h>
48#include <locale.h> 48#include <locale.h>
49#include <stdbool.h> 49#include <stdbool.h>
50#include <stdio.h> 50#include <stdio.h>
51#include <stdlib.h> 51#include <stdlib.h>
52#include <string.h> 52#include <string.h>
53#include <unistd.h> 53#include <unistd.h>
54 54
55#include "grep.h" 55#include "grep.h"
56 56
57#ifndef WITHOUT_NLS 57#ifndef WITHOUT_NLS
58#include <nl_types.h> 58#include <nl_types.h>
59nl_catd catalog; 59nl_catd catalog;
60#endif 60#endif
61 61
62/* 62/*
63 * Default messags to use when NLS is disabled or no catalogue 63 * Default messages to use when NLS is disabled or no catalogue
64 * is found. 64 * is found.
65 */ 65 */
66const char *errstr[] = { 66const char *errstr[] = {
67 "", 67 "",
68/* 1*/ "(standard input)", 68/* 1*/ "(standard input)",
69/* 2*/ "cannot read bzip2 compressed file", 69/* 2*/ "cannot read bzip2 compressed file",
70/* 3*/ "unknown %s option", 70/* 3*/ "unknown %s option",
71/* 4*/ "usage: %s [-abcDEFGHhIiJLlmnOoPqRSsUVvwxZz] [-A num] [-B num] [-C[num]]\n", 71/* 4*/ "usage: %s [-abcDEFGHhIiJLlmnOoPqRSsUVvwxZz] [-A num] [-B num] [-C[num]]\n",
72/* 5*/ "\t[-e pattern] [-f file] [--binary-files=value] [--color=when]\n", 72/* 5*/ "\t[-e pattern] [-f file] [--binary-files=value] [--color=when]\n",
73/* 6*/ "\t[--context[=num]] [--directories=action] [--label] [--line-buffered]\n", 73/* 6*/ "\t[--context[=num]] [--directories=action] [--label] [--line-buffered]\n",
74/* 7*/ "\t[pattern] [file ...]\n", 74/* 7*/ "\t[pattern] [file ...]\n",
75/* 8*/ "Binary file %s matches\n", 75/* 8*/ "Binary file %s matches\n",
76/* 9*/ "%s (BSD grep) %s\n", 76/* 9*/ "%s (BSD grep) %s\n",
@@ -320,27 +320,27 @@ main(int argc, char *argv[]) @@ -320,27 +320,27 @@ main(int argc, char *argv[])
320 char **aargv, **eargv, *eopts; 320 char **aargv, **eargv, *eopts;
321 char *ep; 321 char *ep;
322 unsigned long long l; 322 unsigned long long l;
323 unsigned int aargc, eargc, i, j; 323 unsigned int aargc, eargc, i, j;
324 int c, lastc, needpattern, newarg, prevoptind; 324 int c, lastc, needpattern, newarg, prevoptind;
325 325
326 setlocale(LC_ALL, ""); 326 setlocale(LC_ALL, "");
327 327
328#ifndef WITHOUT_NLS 328#ifndef WITHOUT_NLS
329 catalog = catopen("grep", NL_CAT_LOCALE); 329 catalog = catopen("grep", NL_CAT_LOCALE);
330#endif 330#endif
331 331
332 /* Check what is the program name of the binary. In this 332 /* Check what is the program name of the binary. In this
333 way we can have all the funcionalities in one binary 333 way we can have all the functionalities in one binary
334 without the need of scripting and using ugly hacks. */ 334 without the need of scripting and using ugly hacks. */
335 switch (__progname[0]) { 335 switch (__progname[0]) {
336 case 'e': 336 case 'e':
337 grepbehave = GREP_EXTENDED; 337 grepbehave = GREP_EXTENDED;
338 break; 338 break;
339 case 'f': 339 case 'f':
340 grepbehave = GREP_FIXED; 340 grepbehave = GREP_FIXED;
341 break; 341 break;
342 case 'g': 342 case 'g':
343 grepbehave = GREP_BASIC; 343 grepbehave = GREP_BASIC;
344 break; 344 break;
345#ifndef WITHOUT_GZIP 345#ifndef WITHOUT_GZIP
346 case 'z': 346 case 'z':