[Midnightbsd-cvs] src [11492] trunk/usr.bin/look: sync with freebsd.

laffer1 at midnightbsd.org laffer1 at midnightbsd.org
Sat Jul 7 13:32:26 EDT 2018


Revision: 11492
          http://svnweb.midnightbsd.org/src/?rev=11492
Author:   laffer1
Date:     2018-07-07 13:32:26 -0400 (Sat, 07 Jul 2018)
Log Message:
-----------
sync with freebsd.

Modified Paths:
--------------
    trunk/usr.bin/look/Makefile
    trunk/usr.bin/look/look.1
    trunk/usr.bin/look/look.c
    trunk/usr.bin/look/pathnames.h

Property Changed:
----------------
    trunk/usr.bin/look/look.1

Modified: trunk/usr.bin/look/Makefile
===================================================================
--- trunk/usr.bin/look/Makefile	2018-07-07 17:31:59 UTC (rev 11491)
+++ trunk/usr.bin/look/Makefile	2018-07-07 17:32:26 UTC (rev 11492)
@@ -1,8 +1,7 @@
+# $MidnightBSD$
 #	@(#)Makefile	8.1 (Berkeley) 6/9/93
-# $FreeBSD$
+# $FreeBSD: stable/10/usr.bin/look/Makefile 226359 2011-10-14 07:24:48Z ed $
 
 PROG=	look
 
-WARNS?=	2
-
 .include <bsd.prog.mk>

Modified: trunk/usr.bin/look/look.1
===================================================================
--- trunk/usr.bin/look/look.1	2018-07-07 17:31:59 UTC (rev 11491)
+++ trunk/usr.bin/look/look.1	2018-07-07 17:32:26 UTC (rev 11492)
@@ -1,3 +1,4 @@
+.\" $MidnightBSD$
 .\" Copyright (c) 1990, 1993
 .\"	The Regents of the University of California.  All rights reserved.
 .\"
@@ -26,7 +27,7 @@
 .\" SUCH DAMAGE.
 .\"
 .\"     @(#)look.1	8.1 (Berkeley) 6/14/93
-.\" $FreeBSD$
+.\" $FreeBSD: stable/10/usr.bin/look/look.1 216370 2010-12-11 08:32:16Z joel $
 .\"
 .Dd July 17, 2004
 .Dt LOOK 1


Property changes on: trunk/usr.bin/look/look.1
___________________________________________________________________
Added: svn:keywords
## -0,0 +1 ##
+MidnightBSD=%H
\ No newline at end of property
Modified: trunk/usr.bin/look/look.c
===================================================================
--- trunk/usr.bin/look/look.c	2018-07-07 17:31:59 UTC (rev 11491)
+++ trunk/usr.bin/look/look.c	2018-07-07 17:32:26 UTC (rev 11492)
@@ -1,3 +1,4 @@
+/* $MidnightBSD$ */
 /*-
  * Copyright (c) 1991, 1993
  *	The Regents of the University of California.  All rights reserved.
@@ -42,7 +43,7 @@
 #endif
 #endif /* not lint */
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD$");
+__FBSDID("$FreeBSD: stable/10/usr.bin/look/look.c 227171 2011-11-06 08:15:59Z ed $");
 
 /*
  * look -- find lines in a sorted list.
@@ -61,6 +62,7 @@
 #include <fcntl.h>
 #include <limits.h>
 #include <locale.h>
+#include <stdint.h>
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
@@ -76,14 +78,14 @@
 #define	GREATER		1
 #define	LESS		(-1)
 
-int dflag, fflag;
+static int dflag, fflag;
 
-char    *binary_search(wchar_t *, unsigned char *, unsigned char *);
-int      compare(wchar_t *, unsigned char *, unsigned char *);
-char    *linear_search(wchar_t *, unsigned char *, unsigned char *);
-int      look(wchar_t *, unsigned char *, unsigned char *);
-wchar_t	*prepkey(const char *, wchar_t);
-void     print_from(wchar_t *, unsigned char *, unsigned char *);
+static char	*binary_search(wchar_t *, unsigned char *, unsigned char *);
+static int	 compare(wchar_t *, unsigned char *, unsigned char *);
+static char	*linear_search(wchar_t *, unsigned char *, unsigned char *);
+static int	 look(wchar_t *, unsigned char *, unsigned char *);
+static wchar_t	*prepkey(const char *, wchar_t);
+static void	 print_from(wchar_t *, unsigned char *, unsigned char *);
 
 static void usage(void);
 
@@ -134,7 +136,7 @@
 	do {
 		if ((fd = open(file, O_RDONLY, 0)) < 0 || fstat(fd, &sb))
 			err(2, "%s", file);
-		if (sb.st_size > SIZE_T_MAX)
+		if ((uintmax_t)sb.st_size > (uintmax_t)SIZE_T_MAX)
 			errx(2, "%s: %s", file, strerror(EFBIG));
 		if (sb.st_size == 0) {
 			close(fd);
@@ -150,7 +152,7 @@
 	exit(match);
 }
 
-wchar_t *
+static wchar_t *
 prepkey(const char *string, wchar_t termchar)
 {
 	const char *readp;
@@ -181,7 +183,7 @@
 	return (key);
 }
 
-int
+static int
 look(wchar_t *string, unsigned char *front, unsigned char *back)
 {
 
@@ -235,7 +237,7 @@
 #define	SKIP_PAST_NEWLINE(p, back) \
 	while (p < back && *p++ != '\n');
 
-char *
+static char *
 binary_search(wchar_t *string, unsigned char *front, unsigned char *back)
 {
 	unsigned char *p;
@@ -269,7 +271,7 @@
  * 	o front points at the first character in a line.
  *	o front is before or at the first line to be printed.
  */
-char *
+static char *
 linear_search(wchar_t *string, unsigned char *front, unsigned char *back)
 {
 	while (front < back) {
@@ -289,7 +291,7 @@
 /*
  * Print as many lines as match string, starting at front.
  */
-void
+static void
 print_from(wchar_t *string, unsigned char *front, unsigned char *back)
 {
 	for (; front < back && compare(string, front, back) == EQUAL; ++front) {
@@ -314,7 +316,7 @@
  * The string "s1" is null terminated.  The string s2 is '\n' terminated (or
  * "back" terminated).
  */
-int
+static int
 compare(wchar_t *s1, unsigned char *s2, unsigned char *back)
 {
 	wchar_t ch1, ch2;

Modified: trunk/usr.bin/look/pathnames.h
===================================================================
--- trunk/usr.bin/look/pathnames.h	2018-07-07 17:31:59 UTC (rev 11491)
+++ trunk/usr.bin/look/pathnames.h	2018-07-07 17:32:26 UTC (rev 11492)
@@ -1,3 +1,4 @@
+/* $MidnightBSD$ */
 /*
  * Copyright (c) 1989, 1993
  *	The Regents of the University of California.  All rights reserved.



More information about the Midnightbsd-cvs mailing list