CVS commit: src/usr.bin/pr

2012-07-31 Thread Brian Ginsbach
Module Name:src
Committed By:   ginsbach
Date:   Wed Aug  1 02:27:48 UTC 2012

Modified Files:
src/usr.bin/pr: pr.c

Log Message:
Minor tweaks to usage:
- Sort options to match pr(1) SYNOPSIS (suggested by wiz)
- Add missing -T timefmt option


To generate a diff of this commit:
cvs rdiff -u -r1.23 -r1.24 src/usr.bin/pr/pr.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/usr.bin/pr/pr.c
diff -u src/usr.bin/pr/pr.c:1.23 src/usr.bin/pr/pr.c:1.24
--- src/usr.bin/pr/pr.c:1.23	Tue Jul 24 02:13:04 2012
+++ src/usr.bin/pr/pr.c	Wed Aug  1 02:27:48 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: pr.c,v 1.23 2012/07/24 02:13:04 ginsbach Exp $	*/
+/*	$NetBSD: pr.c,v 1.24 2012/08/01 02:27:48 ginsbach Exp $	*/
 
 /*-
  * Copyright (c) 1991 Keith Muller.
@@ -45,7 +45,7 @@ __COPYRIGHT(@(#) Copyright (c) 1993\
 #if 0
 from: static char sccsid[] = @(#)pr.c	8.1 (Berkeley) 6/6/93;
 #else
-__RCSID($NetBSD: pr.c,v 1.23 2012/07/24 02:13:04 ginsbach Exp $);
+__RCSID($NetBSD: pr.c,v 1.24 2012/08/01 02:27:48 ginsbach Exp $);
 #endif
 #endif /* not lint */
 
@@ -1612,11 +1612,14 @@ static void
 usage(void)
 {
 	(void)fputs(
-	 usage: pr [+page] [-col] [-adFmrt] [-e[ch][gap]] [-h header]\n,errf);
+	 usage: pr [+page] [-col] [-adFfmprt] [-e[ch][gap]] [-h header]\n,
+		errf);
 	(void)fputs(
-	   [-i[ch][gap]] [-l line] [-n[ch][width]] [-o offset]\n,errf);
+	   [-i[ch][gap]] [-l line] [-n[ch][width]] [-o offset]\n,
+		errf);
 	(void)fputs(
-	   [-s[ch]] [-w width] [-fp] [-] [file ...]\n, errf);
+	   [-s[ch]] [-T timefmt] [-w width] [-] [file ...]\n,
+		errf);
 }
 
 /*



CVS commit: src/usr.bin/pr

2012-07-31 Thread Brian Ginsbach
Module Name:src
Committed By:   ginsbach
Date:   Wed Aug  1 02:36:17 UTC 2012

Modified Files:
src/usr.bin/pr: pr.1

Log Message:
- Fix optional argument options (e, i, n, s) in SYNOPSIS and DESCRIPTION
  + First three take two optional arguments
  + All require no space between option and optional argument(s)
  + Make sure that -e and -i similarly describe optional [char] and [gap]


To generate a diff of this commit:
cvs rdiff -u -r1.21 -r1.22 src/usr.bin/pr/pr.1

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/usr.bin/pr/pr.1
diff -u src/usr.bin/pr/pr.1:1.21 src/usr.bin/pr/pr.1:1.22
--- src/usr.bin/pr/pr.1:1.21	Fri Jul 27 20:49:48 2012
+++ src/usr.bin/pr/pr.1	Wed Aug  1 02:36:17 2012
@@ -1,4 +1,4 @@
-.\	$NetBSD: pr.1,v 1.21 2012/07/27 20:49:48 wiz Exp $
+.\	$NetBSD: pr.1,v 1.22 2012/08/01 02:36:17 ginsbach Exp $
 .\
 .\ Copyright (c) 1991 Keith Muller.
 .\ Copyright (c) 1993
@@ -35,7 +35,7 @@
 .\
 .\ from: @(#)pr.1	8.1 (Berkeley) 6/6/93
 .\
-.Dd May 4, 2012
+.Dd July 31, 2012
 .Dt PR 1
 .Os
 .Sh NAME
@@ -47,18 +47,15 @@
 .Op Fl Ar column
 .Op Fl adFfmprt
 .Oo
-.Fl e
-.Oo Ar char Oc Ns Op Ar gap
+.Fl e Ns Oo Ar char Oc Ns Op Ar gap
 .Oc
 .Op Fl h Ar header
 .Oo
-.Fl i
-.Oo Ar char Oc Ns Op Ar gap
+.Fl i Ns Oo Ar char Oc Ns Op Ar gap
 .Oc
 .Op Fl l Ar lines
 .Oo
-.Fl n
-.Oo Ar char Oc Ns Op Ar width
+.Fl n Ns Oo Ar char Oc Ns Op Ar width
 .Oc
 .Op Fl o Ar offset
 .Oo
@@ -135,7 +132,7 @@ An extra
 character is output following every
 .Aq newline
 found in the input.
-.It Fl e Ar \[char\]\[gap\]
+.It Fl e Ns Oo Ar char Oc Ns Op Ar gap
 Expand each input
 .Aq tab
 to the next greater column
@@ -155,6 +152,12 @@ number of
 If any nondigit character,
 .Ar char ,
 is specified, it is used as the input tab character.
+If the first character of
+.Ar char
+is a digit then
+.Ar char
+is treated as
+.Ar gap .
 .It Fl F
 Use a
 .Aq Em form-feed
@@ -174,7 +177,7 @@ Use the string
 to replace the
 .Ar file name
 in the header line.
-.It Fl i Ar \[char\]\[gap\]
+.It Fl i Ns Oo Ar char Oc Ns Op Ar gap
 In output, replace multiple
 .Ao space Ac Ns s
 with
@@ -228,7 +231,7 @@ The options
 and
 .Fl i
 are assumed.
-.It Fl n Ar \[char\]\[width\]
+.It Fl n Ns Oo Ar char Oc Ns Op Ar width
 Provide
 .Ar width
 digit line numbering.
@@ -271,7 +274,7 @@ to be read on
 .Pa /dev/tty .
 .It Fl r
 Write no diagnostic reports on failure to open a file.
-.It Fl s Op Ar char
+.It Fl s Ns Op Ar char
 Separate text columns by the single character
 .Ar char
 instead of by the appropriate number of



CVS commit: src/usr.bin/pr

2012-07-27 Thread Thomas Klausner
Module Name:src
Committed By:   wiz
Date:   Fri Jul 27 18:28:53 UTC 2012

Modified Files:
src/usr.bin/pr: pr.1

Log Message:
New sentence, new line.
Use Aq or Ao/Ac instead of \*[Lt] \*[Gt].
Remove duplicate RCS Id.


To generate a diff of this commit:
cvs rdiff -u -r1.19 -r1.20 src/usr.bin/pr/pr.1

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/usr.bin/pr/pr.1
diff -u src/usr.bin/pr/pr.1:1.19 src/usr.bin/pr/pr.1:1.20
--- src/usr.bin/pr/pr.1:1.19	Tue Jul 24 02:13:04 2012
+++ src/usr.bin/pr/pr.1	Fri Jul 27 18:28:53 2012
@@ -1,4 +1,4 @@
-.\	$NetBSD: pr.1,v 1.19 2012/07/24 02:13:04 ginsbach Exp $
+.\	$NetBSD: pr.1,v 1.20 2012/07/27 18:28:53 wiz Exp $
 .\
 .\ Copyright (c) 1991 Keith Muller.
 .\ Copyright (c) 1993
@@ -34,7 +34,6 @@
 .\ SUCH DAMAGE.
 .\
 .\ from: @(#)pr.1	8.1 (Berkeley) 6/6/93
-.\	$NetBSD: pr.1,v 1.19 2012/07/24 02:13:04 ginsbach Exp $
 .\
 .Dd May 4, 2012
 .Dt PR 1
@@ -96,7 +95,7 @@ utility has completed processing.
 When multiple column output is specified,
 text columns are of equal width.
 By default text columns are separated by at least one
-.Em \*[Lt]blank\*[Gt] .
+.Aq Em blank .
 Input lines that do not fit into a text column are truncated.
 Lines are not truncated under single column output.
 .Sh OPTIONS
@@ -134,11 +133,16 @@ This option requires the use of the
 .Fl column
 option.
 .It Fl d
-Produce output that is double spaced. An extra
-.Em \*[Lt]newline\*[Gt]
-character is output following every \*[Lt]newline\*[Gt] found in the input.
+Produce output that is double spaced.
+An extra
+.Aq Em newline
+character is output following every
+.Aq newline
+found in the input.
 .It Fl e Ar \[char\]\[gap\]
-Expand each input \*[Lt]tab\*[Gt] to the next greater column
+Expand each input
+.Aq tab
+to the next greater column
 position specified by the formula
 .Ar n*gap+1 ,
 where
@@ -148,20 +152,20 @@ If
 .Ar gap
 is zero or is omitted the default is 8.
 All
-.Em \*[Lt]tab\*[Gt]
+.Aq Em tab
 characters in the input are expanded into the appropriate
 number of
-.Em \*[Lt]space\*[Gt]s .
+.Ao Em space Ac Ns s .
 If any nondigit character,
 .Ar char ,
 is specified, it is used as the input tab character.
 .It Fl F
 Use a
-.Em \*[Lt]form-feed\*[Gt]
+.Aq Em form-feed
 character for new pages,
 instead of the default behavior that uses a
 sequence of
-.Em \*[Lt]newline\*[Gt]
+.Aq Em newline
 characters.
 .It Fl f
 Same as
@@ -175,21 +179,27 @@ to replace the
 .Ar file name
 in the header line.
 .It Fl i Ar \[char\]\[gap\]
-In output, replace multiple \*[Lt]space\*[Gt]s with \*[Lt]tab\*[Gt]s whenever two or more
-adjacent \*[Lt]space\*[Gt]s reach column positions
+In output, replace multiple
+.Ao space Ac Ns s
+with
+.Ao tab Ac Ns s
+whenever two or more
+adjacent
+.Ao space Ac Ns s
+reach column positions
 .Ar gap+1 ,
 .Ar 2*gap+1 ,
 etc.
 If
 .Ar gap
 is zero or omitted, default
-.Em \*[Lt]tab\*[Gt]
+.Aq Em tab
 settings at every eighth column position
 is used.
 If any nondigit character,
 .Ar char ,
 is specified, it is used as the output
-.Em \*[Lt]tab\*[Gt]
+.Aq Em tab
 character.
 If the first character of
 .Ar char
@@ -237,17 +247,18 @@ output.
 If
 .Ar char
 (any nondigit character) is given, it is appended to the line number to
-separate it from whatever follows. The default for
+separate it from whatever follows.
+The default for
 .Ar char
 is a
-.Em \*[Lt]tab\*[Gt] .
+.Aq Em tab .
 Line numbers longer than
 .Ar width
 columns are truncated.
 .It Fl o Ar offset
 Each line of output is preceded by
 .Ar offset
-.Em \*[Lt]spaces\*[Gt]s .
+.Ao Em space Ac Ns s .
 If the
 .Fl o
 option is not specified, the default is zero.
@@ -257,9 +268,9 @@ Pause before beginning each page if the
 standard output is associated with a terminal.
 .Nm
 will write an
-.Em \*[Lt]alert\*[Gt]
+.Aq Em alert
 to standard error and wait for a
-.Em \*[Lt]carriage-return\*[Gt]
+.Aq Em carriage-return
 to be read on
 .Pa /dev/tty .
 .It Fl r
@@ -268,11 +279,11 @@ Write no diagnostic reports on failure t
 Separate text columns by the single character
 .Ar char
 instead of by the appropriate number of
-.Em \*[Lt]space\*[Gt]s
+.Ao Em space Ac Ns s
 (default for
 .Ar char
 is the
-.Em \*[Lt]tab\*[Gt]
+.Aq Em tab
 character).
 .It Fl T
 Specify an



CVS commit: src/usr.bin/pr

2012-07-27 Thread Thomas Klausner
Module Name:src
Committed By:   wiz
Date:   Fri Jul 27 20:49:48 UTC 2012

Modified Files:
src/usr.bin/pr: pr.1

Log Message:
Fix error in SYNOPSIS, sort.


To generate a diff of this commit:
cvs rdiff -u -r1.20 -r1.21 src/usr.bin/pr/pr.1

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/usr.bin/pr/pr.1
diff -u src/usr.bin/pr/pr.1:1.20 src/usr.bin/pr/pr.1:1.21
--- src/usr.bin/pr/pr.1:1.20	Fri Jul 27 18:28:53 2012
+++ src/usr.bin/pr/pr.1	Fri Jul 27 20:49:48 2012
@@ -1,4 +1,4 @@
-.\	$NetBSD: pr.1,v 1.20 2012/07/27 18:28:53 wiz Exp $
+.\	$NetBSD: pr.1,v 1.21 2012/07/27 20:49:48 wiz Exp $
 .\
 .\ Copyright (c) 1991 Keith Muller.
 .\ Copyright (c) 1993
@@ -47,28 +47,24 @@
 .Op Fl Ar column
 .Op Fl adFfmprt
 .Oo
-.Op Fl e
-.Op Ar char
-.Op Ar gap
+.Fl e
+.Oo Ar char Oc Ns Op Ar gap
 .Oc
 .Op Fl h Ar header
 .Oo
-.Op Fl i
-.Op Ar char
-.Op Ar gap
+.Fl i
+.Oo Ar char Oc Ns Op Ar gap
 .Oc
 .Op Fl l Ar lines
-.Op Fl o Ar offset
 .Oo
-.Op Fl s
-.Op Ar char
+.Fl n
+.Oo Ar char Oc Ns Op Ar width
 .Oc
-.Op Fl T Ar timefmt
+.Op Fl o Ar offset
 .Oo
-.Op Fl n
-.Op Ar char
-.Op Ar width
+.Fl s Ns Op Ar char
 .Oc
+.Op Fl T Ar timefmt
 .Op Fl w Ar width
 .Op -
 .Op Ar file ...
@@ -275,7 +271,7 @@ to be read on
 .Pa /dev/tty .
 .It Fl r
 Write no diagnostic reports on failure to open a file.
-.It Fl s Ar char
+.It Fl s Op Ar char
 Separate text columns by the single character
 .Ar char
 instead of by the appropriate number of



CVS commit: src/usr.bin/pr

2012-07-23 Thread Brian Ginsbach
Module Name:src
Committed By:   ginsbach
Date:   Tue Jul 24 02:13:05 UTC 2012

Modified Files:
src/usr.bin/pr: pr.1 pr.c pr.h

Log Message:
- Fix PR 19468 by adding -f and -p options to pr(1).
  Changes adapted from patch by Ryan Younce and FreeBSD.  The provided
  patch was not used directly as the changes didn't mimic the System V
  origins of these options.  System V pr(1) does not pause for empty files.
  These changes follow that precedent.

- Improve man page description of the -i option.


To generate a diff of this commit:
cvs rdiff -u -r1.18 -r1.19 src/usr.bin/pr/pr.1
cvs rdiff -u -r1.22 -r1.23 src/usr.bin/pr/pr.c
cvs rdiff -u -r1.4 -r1.5 src/usr.bin/pr/pr.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/usr.bin/pr/pr.1
diff -u src/usr.bin/pr/pr.1:1.18 src/usr.bin/pr/pr.1:1.19
--- src/usr.bin/pr/pr.1:1.18	Sun Apr  8 22:00:39 2012
+++ src/usr.bin/pr/pr.1	Tue Jul 24 02:13:04 2012
@@ -1,8 +1,10 @@
-.\	$NetBSD: pr.1,v 1.18 2012/04/08 22:00:39 wiz Exp $
+.\	$NetBSD: pr.1,v 1.19 2012/07/24 02:13:04 ginsbach Exp $
 .\
 .\ Copyright (c) 1991 Keith Muller.
 .\ Copyright (c) 1993
 .\	The Regents of the University of California.  All rights reserved.
+.\ Copyright (c) 1994-1995, 1997, 1999-2003, 2009, 2012
+.\	The NetBSD Foundation, Inc.
 .\
 .\ This code is derived from software contributed to Berkeley by
 .\ Keith Muller of the University of California, San Diego.
@@ -32,9 +34,9 @@
 .\ SUCH DAMAGE.
 .\
 .\ from: @(#)pr.1	8.1 (Berkeley) 6/6/93
-.\	$NetBSD: pr.1,v 1.18 2012/04/08 22:00:39 wiz Exp $
+.\	$NetBSD: pr.1,v 1.19 2012/07/24 02:13:04 ginsbach Exp $
 .\
-.Dd June 6, 1993
+.Dd May 4, 2012
 .Dt PR 1
 .Os
 .Sh NAME
@@ -44,7 +46,7 @@
 .Nm
 .Op Ar \+page
 .Op Fl Ar column
-.Op Fl adFmrt
+.Op Fl adFfmprt
 .Oo
 .Op Fl e
 .Op Ar char
@@ -161,6 +163,11 @@ instead of the default behavior that use
 sequence of
 .Em \*[Lt]newline\*[Gt]
 characters.
+.It Fl f
+Same as
+.Fl F .
+Additionally pause before beginning the first page
+if the standard output is associated with a terminal.
 .It Fl h Ar header
 Use the string
 .Ar header
@@ -184,6 +191,12 @@ If any nondigit character,
 is specified, it is used as the output
 .Em \*[Lt]tab\*[Gt]
 character.
+If the first character of
+.Ar char
+is a digit then
+.Ar char
+is treated as
+.Ar gap .
 .It Fl l Ar lines
 Override the 66 line default and reset the page length to
 .Ar lines .
@@ -239,6 +252,16 @@ If the
 .Fl o
 option is not specified, the default is zero.
 The space taken is in addition to the output line width.
+.It Fl p
+Pause before beginning each page if the
+standard output is associated with a terminal.
+.Nm
+will write an
+.Em \*[Lt]alert\*[Gt]
+to standard error and wait for a
+.Em \*[Lt]carriage-return\*[Gt]
+to be read on
+.Pa /dev/tty .
 .It Fl r
 Write no diagnostic reports on failure to open a file.
 .It Fl s Ar char
@@ -324,5 +347,5 @@ file printing is complete (when printing
 The
 .Nm
 utility is
-.St -p1003.2
+.St -p1003.1-2008
 compatible.

Index: src/usr.bin/pr/pr.c
diff -u src/usr.bin/pr/pr.c:1.22 src/usr.bin/pr/pr.c:1.23
--- src/usr.bin/pr/pr.c:1.22	Mon Mar 12 18:06:24 2012
+++ src/usr.bin/pr/pr.c	Tue Jul 24 02:13:04 2012
@@ -1,9 +1,11 @@
-/*	$NetBSD: pr.c,v 1.22 2012/03/12 18:06:24 christos Exp $	*/
+/*	$NetBSD: pr.c,v 1.23 2012/07/24 02:13:04 ginsbach Exp $	*/
 
 /*-
  * Copyright (c) 1991 Keith Muller.
  * Copyright (c) 1993
  *	The Regents of the University of California.  All rights reserved.
+ * Copyright (c) 2012
+ *	The NetBSD Foundation, Inc.
  *
  * This code is derived from software contributed to Berkeley by
  * Keith Muller of the University of California, San Diego.
@@ -43,7 +45,7 @@ __COPYRIGHT(@(#) Copyright (c) 1993\
 #if 0
 from: static char sccsid[] = @(#)pr.c	8.1 (Berkeley) 6/6/93;
 #else
-__RCSID($NetBSD: pr.c,v 1.22 2012/03/12 18:06:24 christos Exp $);
+__RCSID($NetBSD: pr.c,v 1.23 2012/07/24 02:13:04 ginsbach Exp $);
 #endif
 #endif /* not lint */
 
@@ -96,9 +98,12 @@ static int	offst;			/* number of page of
 static int	nodiag;			/* do not report file open errors */
 static char	schar;			/* text column separation character */
 static int	sflag;			/* -s option for multiple columns */
+static int	ttyout;			/* output is a tty */
 static int	nohead;			/* do not write head and trailer */
+static int	pgpause;		/* pause before each page */
 static int	pgwd;			/* page width with multiple col output */
 static const char *timefrmt = TIMEFMT;	/* time conversion string */
+static FILE	*ttyinf;		/* input terminal for page pauses */
 
 /*
  * misc globals
@@ -120,6 +125,7 @@ static int	 onecol(int, char **);
 static int	 otln(char *, int, int *, int *, int);
 static void	 pfail(void);
 static int	 prhead(char *, const char *, int);
+static void	 prpause(int);
 static int	 prtail(int, int);
 static int	 setup(int, char **);
 __dead static void	 terminate(int);
@@ -242,9 +248,14 @@ onecol(int argc, char *argv[])
  

CVS commit: src/usr.bin/pr

2012-03-12 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Mon Mar 12 18:06:24 UTC 2012

Modified Files:
src/usr.bin/pr: pr.c

Log Message:
PR/41880: Ralph G. Previous fix for PR/5797 broke since space separator.


To generate a diff of this commit:
cvs rdiff -u -r1.21 -r1.22 src/usr.bin/pr/pr.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/usr.bin/pr/pr.c
diff -u src/usr.bin/pr/pr.c:1.21 src/usr.bin/pr/pr.c:1.22
--- src/usr.bin/pr/pr.c:1.21	Tue Sep  6 14:26:06 2011
+++ src/usr.bin/pr/pr.c	Mon Mar 12 14:06:24 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: pr.c,v 1.21 2011/09/06 18:26:06 joerg Exp $	*/
+/*	$NetBSD: pr.c,v 1.22 2012/03/12 18:06:24 christos Exp $	*/
 
 /*-
  * Copyright (c) 1991 Keith Muller.
@@ -43,7 +43,7 @@ __COPYRIGHT(@(#) Copyright (c) 1993\
 #if 0
 from: static char sccsid[] = @(#)pr.c	8.1 (Berkeley) 6/6/93;
 #else
-__RCSID($NetBSD: pr.c,v 1.21 2011/09/06 18:26:06 joerg Exp $);
+__RCSID($NetBSD: pr.c,v 1.22 2012/03/12 18:06:24 christos Exp $);
 #endif
 #endif /* not lint */
 
@@ -1138,14 +1138,7 @@ otln(char *buf, int cnt, int *svips, int
 			/*
 			 * got a non space char; contract out spaces
 			 */
-			while (ops  ips) {
-/*
- * use one space if necessary
- */
-if (ips - ops == 1) {
-	putchar(' ');
-	break;
-}
+			while (ips - ops  1) {
 /*
  * use as many ochar as will fit
  */
@@ -1190,14 +1183,7 @@ otln(char *buf, int cnt, int *svips, int
 		}
 
 		if (mor  0) {
-			while (ops  ips) {
-/*
- * use one space if necessary
- */
-if (ips - ops == 1) {
-	putchar(' ');
-	break;
-}
+			while (ips - ops  1) {
 /*
  * use as many ochar as will fit
  */



CVS commit: src/usr.bin/pr

2011-09-06 Thread Joerg Sonnenberger
Module Name:src
Committed By:   joerg
Date:   Tue Sep  6 18:26:06 UTC 2011

Modified Files:
src/usr.bin/pr: egetopt.c extern.h pr.c

Log Message:
ANSIfy, static + __dead


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/usr.bin/pr/egetopt.c
cvs rdiff -u -r1.5 -r1.6 src/usr.bin/pr/extern.h
cvs rdiff -u -r1.20 -r1.21 src/usr.bin/pr/pr.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/usr.bin/pr/egetopt.c
diff -u src/usr.bin/pr/egetopt.c:1.8 src/usr.bin/pr/egetopt.c:1.9
--- src/usr.bin/pr/egetopt.c:1.8	Mon Apr 13 00:37:05 2009
+++ src/usr.bin/pr/egetopt.c	Tue Sep  6 18:26:06 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: egetopt.c,v 1.8 2009/04/13 00:37:05 lukem Exp $	*/
+/*	$NetBSD: egetopt.c,v 1.9 2011/09/06 18:26:06 joerg Exp $	*/
 
 /*-
  * Copyright (c) 1991 Keith Muller.
@@ -38,7 +38,7 @@
 #if 0
 from: static char sccsid[] = @(#)egetopt.c	8.1 (Berkeley) 6/6/93;
 #else
-__RCSID($NetBSD: egetopt.c,v 1.8 2009/04/13 00:37:05 lukem Exp $);
+__RCSID($NetBSD: egetopt.c,v 1.9 2011/09/06 18:26:06 joerg Exp $);
 #endif
 #endif /* not lint */
 
@@ -67,13 +67,10 @@
 char	*eoptarg;		/* argument associated with option */
 
 #define	BADCH	(int)'?'
-char EMSG[1] = { '\0' };
+static char EMSG[1] = { '\0' };
 
 int
-egetopt(nargc, nargv, ostr)
-	int nargc;
-	char * const *nargv;
-	const char *ostr;
+egetopt(int nargc, char * const *nargv, const char *ostr)
 {
 	static char *place = EMSG;	/* option letter processing */
 	char *oli;			/* option letter list index */

Index: src/usr.bin/pr/extern.h
diff -u src/usr.bin/pr/extern.h:1.5 src/usr.bin/pr/extern.h:1.6
--- src/usr.bin/pr/extern.h:1.5	Mon Apr 13 00:37:05 2009
+++ src/usr.bin/pr/extern.h	Tue Sep  6 18:26:06 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: extern.h,v 1.5 2009/04/13 00:37:05 lukem Exp $	*/
+/*	$NetBSD: extern.h,v 1.6 2011/09/06 18:26:06 joerg Exp $	*/
 
 /*-
  * Copyright (c) 1991 Keith Muller.
@@ -33,27 +33,10 @@
  * SUCH DAMAGE.
  *
  *  from: @(#)extern.h	8.1 (Berkeley) 6/6/93
- *	$NetBSD: extern.h,v 1.5 2009/04/13 00:37:05 lukem Exp $
+ *	$NetBSD: extern.h,v 1.6 2011/09/06 18:26:06 joerg Exp $
  */
 
 extern int eoptind;
 extern char *eoptarg;
 
-void	 addnum __P((char *, int, int));
-int	 egetopt __P((int, char * const *, const char *));
-void	 flsh_errs __P((void));
-int	 horzcol __P((int, char **));
-int	 inln __P((FILE *, char *, int, int *, int, int *));
-int	 inskip __P((FILE *, int, int));
-void	 mfail __P((void));
-int	 mulfile __P((int, char **));
-FILE	*nxtfile __P((int, char **, const char **, char *, int));
-int	 onecol __P((int, char **));
-int	 otln __P((char *, int, int *, int *, int));
-void	 pfail __P((void));
-int	 prhead __P((char *, const char *, int));
-int	 prtail __P((int, int));
-int	 setup __P((int, char **));
-void	 terminate __P((int));
-void	 usage __P((void));
-int	 vertcol __P((int, char **));
+int	 egetopt(int, char * const *, const char *);

Index: src/usr.bin/pr/pr.c
diff -u src/usr.bin/pr/pr.c:1.20 src/usr.bin/pr/pr.c:1.21
--- src/usr.bin/pr/pr.c:1.20	Mon Apr 13 00:37:05 2009
+++ src/usr.bin/pr/pr.c	Tue Sep  6 18:26:06 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: pr.c,v 1.20 2009/04/13 00:37:05 lukem Exp $	*/
+/*	$NetBSD: pr.c,v 1.21 2011/09/06 18:26:06 joerg Exp $	*/
 
 /*-
  * Copyright (c) 1991 Keith Muller.
@@ -43,7 +43,7 @@
 #if 0
 from: static char sccsid[] = @(#)pr.c	8.1 (Berkeley) 6/6/93;
 #else
-__RCSID($NetBSD: pr.c,v 1.20 2009/04/13 00:37:05 lukem Exp $);
+__RCSID($NetBSD: pr.c,v 1.21 2011/09/06 18:26:06 joerg Exp $);
 #endif
 #endif /* not lint */
 
@@ -77,43 +77,57 @@
 /*
  * parameter variables
  */
-int	pgnm;			/* starting page number */
-int	clcnt;			/* number of columns */
-int	colwd;			/* column data width - multiple columns */
-int	across;			/* mult col flag; write across page */
-int	dspace;			/* double space flag */
-char	inchar;			/* expand input char */
-int	ingap;			/* expand input gap */
-int	formfeed;		/* use formfeed as trailer */
-char	*header;		/* header name instead of file name */
-char	ochar;			/* contract output char */
-int	ogap;			/* contract output gap */
-int	lines;			/* number of lines per page */
-int	merge;			/* merge multiple files in output */
-char	nmchar;			/* line numbering append char */
-int	nmwd;			/* width of line number field */
-int	offst;			/* number of page offset spaces */
-int	nodiag;			/* do not report file open errors */
-char	schar;			/* text column separation character */
-int	sflag;			/* -s option for multiple columns */
-int	nohead;			/* do not write head and trailer */
-int	pgwd;			/* page width with multiple col output */
-const char *timefrmt = TIMEFMT;	/* time conversion string */
+static int	pgnm;			/* starting page number */
+static int	clcnt;			/* number of columns */
+static int	colwd;			/* column data width - multiple columns */
+static int	across;			/* mult col flag; write across page */
+static int	dspace;			/* double space flag */
+static char	inchar;	

CVS commit: src/usr.bin/pr

2011-08-16 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Tue Aug 16 12:05:52 UTC 2011

Modified Files:
src/usr.bin/pr: Makefile

Log Message:
document non-literal format string.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/usr.bin/pr/Makefile

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/usr.bin/pr/Makefile
diff -u src/usr.bin/pr/Makefile:1.3 src/usr.bin/pr/Makefile:1.4
--- src/usr.bin/pr/Makefile:1.3	Sun Oct 14 07:21:32 2007
+++ src/usr.bin/pr/Makefile	Tue Aug 16 08:05:52 2011
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.3 2007/10/14 11:21:32 lukem Exp $
+#	$NetBSD: Makefile,v 1.4 2011/08/16 12:05:52 christos Exp $
 #	from: @(#)Makefile	8.1 (Berkeley) 6/6/93
 
 PROG=	pr
@@ -7,4 +7,6 @@
 DPADD+=	${LIBUTIL}
 LDADD+=	-lutil
 
+COPTS.pr.c += -Wno-format-nonliteral
+
 .include bsd.prog.mk



CVS commit: src/usr.bin/pr

2009-04-12 Thread Luke Mewburn
Module Name:src
Committed By:   lukem
Date:   Mon Apr 13 00:37:05 UTC 2009

Modified Files:
src/usr.bin/pr: egetopt.c extern.h pr.c

Log Message:
Fix -Wcast-qual issues


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/usr.bin/pr/egetopt.c
cvs rdiff -u -r1.4 -r1.5 src/usr.bin/pr/extern.h
cvs rdiff -u -r1.19 -r1.20 src/usr.bin/pr/pr.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/usr.bin/pr/egetopt.c
diff -u src/usr.bin/pr/egetopt.c:1.7 src/usr.bin/pr/egetopt.c:1.8
--- src/usr.bin/pr/egetopt.c:1.7	Mon Oct 13 07:41:22 2003
+++ src/usr.bin/pr/egetopt.c	Mon Apr 13 00:37:05 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: egetopt.c,v 1.7 2003/10/13 07:41:22 agc Exp $	*/
+/*	$NetBSD: egetopt.c,v 1.8 2009/04/13 00:37:05 lukem Exp $	*/
 
 /*-
  * Copyright (c) 1991 Keith Muller.
@@ -38,7 +38,7 @@
 #if 0
 from: static char sccsid[] = @(#)egetopt.c	8.1 (Berkeley) 6/6/93;
 #else
-__RCSID($NetBSD: egetopt.c,v 1.7 2003/10/13 07:41:22 agc Exp $);
+__RCSID($NetBSD: egetopt.c,v 1.8 2009/04/13 00:37:05 lukem Exp $);
 #endif
 #endif /* not lint */
 
@@ -67,7 +67,7 @@
 char	*eoptarg;		/* argument associated with option */
 
 #define	BADCH	(int)'?'
-#define	EMSG	
+char EMSG[1] = { '\0' };
 
 int
 egetopt(nargc, nargv, ostr)

Index: src/usr.bin/pr/extern.h
diff -u src/usr.bin/pr/extern.h:1.4 src/usr.bin/pr/extern.h:1.5
--- src/usr.bin/pr/extern.h:1.4	Mon Oct 13 07:41:22 2003
+++ src/usr.bin/pr/extern.h	Mon Apr 13 00:37:05 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: extern.h,v 1.4 2003/10/13 07:41:22 agc Exp $	*/
+/*	$NetBSD: extern.h,v 1.5 2009/04/13 00:37:05 lukem Exp $	*/
 
 /*-
  * Copyright (c) 1991 Keith Muller.
@@ -33,7 +33,7 @@
  * SUCH DAMAGE.
  *
  *  from: @(#)extern.h	8.1 (Berkeley) 6/6/93
- *	$NetBSD: extern.h,v 1.4 2003/10/13 07:41:22 agc Exp $
+ *	$NetBSD: extern.h,v 1.5 2009/04/13 00:37:05 lukem Exp $
  */
 
 extern int eoptind;
@@ -47,11 +47,11 @@
 int	 inskip __P((FILE *, int, int));
 void	 mfail __P((void));
 int	 mulfile __P((int, char **));
-FILE	*nxtfile __P((int, char **, char **, char *, int));
+FILE	*nxtfile __P((int, char **, const char **, char *, int));
 int	 onecol __P((int, char **));
 int	 otln __P((char *, int, int *, int *, int));
 void	 pfail __P((void));
-int	 prhead __P((char *, char *, int));
+int	 prhead __P((char *, const char *, int));
 int	 prtail __P((int, int));
 int	 setup __P((int, char **));
 void	 terminate __P((int));

Index: src/usr.bin/pr/pr.c
diff -u src/usr.bin/pr/pr.c:1.19 src/usr.bin/pr/pr.c:1.20
--- src/usr.bin/pr/pr.c:1.19	Mon Jul 21 14:19:24 2008
+++ src/usr.bin/pr/pr.c	Mon Apr 13 00:37:05 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: pr.c,v 1.19 2008/07/21 14:19:24 lukem Exp $	*/
+/*	$NetBSD: pr.c,v 1.20 2009/04/13 00:37:05 lukem Exp $	*/
 
 /*-
  * Copyright (c) 1991 Keith Muller.
@@ -43,7 +43,7 @@
 #if 0
 from: static char sccsid[] = @(#)pr.c	8.1 (Berkeley) 6/6/93;
 #else
-__RCSID($NetBSD: pr.c,v 1.19 2008/07/21 14:19:24 lukem Exp $);
+__RCSID($NetBSD: pr.c,v 1.20 2009/04/13 00:37:05 lukem Exp $);
 #endif
 #endif /* not lint */
 
@@ -98,7 +98,7 @@
 int	sflag;			/* -s option for multiple columns */
 int	nohead;			/* do not write head and trailer */
 int	pgwd;			/* page width with multiple col output */
-char	*timefrmt = TIMEFMT;	/* time conversion string */
+const char *timefrmt = TIMEFMT;	/* time conversion string */
 
 /*
  * misc globals
@@ -165,7 +165,7 @@
 	char *hbuf = NULL;
 	char *ohbuf;
 	FILE *inf = NULL;
-	char *fname;
+	const char *fname;
 	int mor;
 	int error = 1;
 
@@ -325,7 +325,7 @@
 	char *buf = NULL;
 	char *hbuf = NULL;
 	char *ohbuf;
-	char *fname;
+	const char *fname;
 	FILE *inf = NULL;
 	int ips = 0;
 	int cps = 0;
@@ -642,7 +642,7 @@
 	char *buf = NULL;
 	char *hbuf = NULL;
 	char *ohbuf;
-	char *fname;
+	const char *fname;
 	FILE *inf = NULL;
 	int ips = 0;
 	int cps = 0;
@@ -796,7 +796,7 @@
 	char *buf = NULL;
 	char *hbuf = NULL;
 	char *ohbuf;
-	char *fname;
+	const char *fname;
 	int ips = 0;
 	int cps = 0;
 	int ops = 0;
@@ -1302,7 +1302,7 @@
 nxtfile(argc, argv, fname, buf, dt)
 	int argc;
 	char **argv;
-	char **fname;
+	const char **fname;
 	char *buf;
 	int dt;
 {
@@ -1470,7 +1470,7 @@
 int
 prhead(buf, fname, pagcnt)
 	char *buf;
-	char *fname;
+	const char *fname;
 	int pagcnt;
 {
 	int ips = 0;