[Midnightbsd-cvs] src [11524] trunk/usr.bin/join: sync with freebsd.

laffer1 at midnightbsd.org laffer1 at midnightbsd.org
Sat Jul 7 15:25:27 EDT 2018


Revision: 11524
          http://svnweb.midnightbsd.org/src/?rev=11524
Author:   laffer1
Date:     2018-07-07 15:25:27 -0400 (Sat, 07 Jul 2018)
Log Message:
-----------
sync with freebsd.

Modified Paths:
--------------
    trunk/usr.bin/join/Makefile
    trunk/usr.bin/join/join.1
    trunk/usr.bin/join/join.c

Added Paths:
-----------
    trunk/usr.bin/join/tests/
    trunk/usr.bin/join/tests/Makefile
    trunk/usr.bin/join/tests/legacy_test.sh
    trunk/usr.bin/join/tests/regress.1.in
    trunk/usr.bin/join/tests/regress.2.in
    trunk/usr.bin/join/tests/regress.out
    trunk/usr.bin/join/tests/regress.sh

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

Modified: trunk/usr.bin/join/Makefile
===================================================================
--- trunk/usr.bin/join/Makefile	2018-07-07 19:23:52 UTC (rev 11523)
+++ trunk/usr.bin/join/Makefile	2018-07-07 19:25:27 UTC (rev 11524)
@@ -1,5 +1,13 @@
+# $MidnightBSD$
+# $FreeBSD: stable/10/usr.bin/join/Makefile 264996 2014-04-27 01:15:10Z jmmv $
 #	@(#)Makefile	8.1 (Berkeley) 6/6/93
 
+.include <bsd.own.mk>
+
 PROG=	join
 
+.if ${MK_TESTS} != "no"
+SUBDIR+= tests
+.endif
+
 .include <bsd.prog.mk>

Modified: trunk/usr.bin/join/join.1
===================================================================
--- trunk/usr.bin/join/join.1	2018-07-07 19:23:52 UTC (rev 11523)
+++ trunk/usr.bin/join/join.1	2018-07-07 19:25:27 UTC (rev 11524)
@@ -1,3 +1,4 @@
+.\" $MidnightBSD$
 .\" Copyright (c) 1990, 1993
 .\"	The Regents of the University of California.  All rights reserved.
 .\"
@@ -29,7 +30,7 @@
 .\" SUCH DAMAGE.
 .\"
 .\"	@(#)join.1	8.3 (Berkeley) 4/28/95
-.\" $MidnightBSD$
+.\" $FreeBSD: stable/10/usr.bin/join/join.1 235597 2012-05-18 03:30:50Z gjb $
 .\"
 .Dd July 5, 2004
 .Dt JOIN 1


Property changes on: trunk/usr.bin/join/join.1
___________________________________________________________________
Added: svn:keywords
## -0,0 +1 ##
+MidnightBSD=%H
\ No newline at end of property
Modified: trunk/usr.bin/join/join.c
===================================================================
--- trunk/usr.bin/join/join.c	2018-07-07 19:23:52 UTC (rev 11523)
+++ trunk/usr.bin/join/join.c	2018-07-07 19:25:27 UTC (rev 11524)
@@ -1,3 +1,4 @@
+/* $MidnightBSD$ */
 /*-
  * Copyright (c) 1991, 1993, 1994
  *	The Regents of the University of California.  All rights reserved.
@@ -43,7 +44,7 @@
 #endif
 #endif /* not lint */
 #include <sys/cdefs.h>
-__MBSDID("$MidnightBSD$");
+__FBSDID("$FreeBSD: stable/10/usr.bin/join/join.c 246319 2013-02-04 10:05:55Z andrew $");
 
 #include <sys/param.h>
 
@@ -83,36 +84,36 @@
 	u_long setcnt;		/* set count */
 	u_long setalloc;	/* set allocated count */
 } INPUT;
-INPUT input1 = { NULL, 0, 0, 1, NULL, 0, 0, 0, 0 },
-      input2 = { NULL, 0, 0, 2, NULL, 0, 0, 0, 0 };
+static INPUT input1 = { NULL, 0, 0, 1, NULL, 0, 0, 0, 0 },
+    input2 = { NULL, 0, 0, 2, NULL, 0, 0, 0, 0 };
 
 typedef struct {
 	u_long	filenum;	/* file number */
 	u_long	fieldno;	/* field number */
 } OLIST;
-OLIST *olist;			/* output field list */
-u_long olistcnt;		/* output field list count */
-u_long olistalloc;		/* output field allocated count */
+static OLIST *olist;		/* output field list */
+static u_long olistcnt;		/* output field list count */
+static u_long olistalloc;	/* output field allocated count */
 
-int joinout = 1;		/* show lines with matched join fields (-v) */
-int needsep;			/* need separator character */
-int spans = 1;			/* span multiple delimiters (-t) */
-char *empty;			/* empty field replacement string (-e) */
+static int joinout = 1;		/* show lines with matched join fields (-v) */
+static int needsep;		/* need separator character */
+static int spans = 1;		/* span multiple delimiters (-t) */
+static char *empty;		/* empty field replacement string (-e) */
 static wchar_t default_tabchar[] = L" \t";
-wchar_t *tabchar = default_tabchar;/* delimiter characters (-t) */
+static wchar_t *tabchar = default_tabchar; /* delimiter characters (-t) */
 
-int  cmp(LINE *, u_long, LINE *, u_long);
-void fieldarg(char *);
-void joinlines(INPUT *, INPUT *);
-int  mbscoll(const char *, const char *);
-char *mbssep(char **, const wchar_t *);
-void obsolete(char **);
-void outfield(LINE *, u_long, int);
-void outoneline(INPUT *, LINE *);
-void outtwoline(INPUT *, LINE *, INPUT *, LINE *);
-void slurp(INPUT *);
-wchar_t *towcs(const char *);
-void usage(void);
+static int  cmp(LINE *, u_long, LINE *, u_long);
+static void fieldarg(char *);
+static void joinlines(INPUT *, INPUT *);
+static int  mbscoll(const char *, const char *);
+static char *mbssep(char **, const wchar_t *);
+static void obsolete(char **);
+static void outfield(LINE *, u_long, int);
+static void outoneline(INPUT *, LINE *);
+static void outtwoline(INPUT *, LINE *, INPUT *, LINE *);
+static void slurp(INPUT *);
+static wchar_t *towcs(const char *);
+static void usage(void);
 
 int
 main(int argc, char *argv[])
@@ -270,7 +271,7 @@
 	exit(0);
 }
 
-void
+static void
 slurp(INPUT *F)
 {
 	LINE *lp, *lastlp, tmp;
@@ -359,7 +360,7 @@
 	}
 }
 
-char *
+static char *
 mbssep(char **stringp, const wchar_t *delim)
 {
 	char *s, *tok;
@@ -388,7 +389,7 @@
 	}
 }
 
-int
+static int
 cmp(LINE *lp1, u_long fieldno1, LINE *lp2, u_long fieldno2)
 {
 	if (lp1->fieldcnt <= fieldno1)
@@ -398,7 +399,7 @@
 	return (mbscoll(lp1->fields[fieldno1], lp2->fields[fieldno2]));
 }
 
-int
+static int
 mbscoll(const char *s1, const char *s2)
 {
 	wchar_t *w1, *w2;
@@ -414,7 +415,7 @@
 	return (ret);
 }
 
-wchar_t *
+static wchar_t *
 towcs(const char *s)
 {
 	wchar_t *wcs;
@@ -428,7 +429,7 @@
 	return (wcs);
 }
 
-void
+static void
 joinlines(INPUT *F1, INPUT *F2)
 {
 	u_long cnt1, cnt2;
@@ -448,7 +449,7 @@
 			outtwoline(F1, &F1->set[cnt1], F2, &F2->set[cnt2]);
 }
 
-void
+static void
 outoneline(INPUT *F, LINE *lp)
 {
 	u_long cnt;
@@ -476,7 +477,7 @@
 	needsep = 0;
 }
 
-void
+static void
 outtwoline(INPUT *F1, LINE *lp1, INPUT *F2, LINE *lp2)
 {
 	u_long cnt;
@@ -512,11 +513,11 @@
 	needsep = 0;
 }
 
-void
+static void
 outfield(LINE *lp, u_long fieldno, int out_empty)
 {
 	if (needsep++)
-		(void)printf("%lc", *tabchar);
+		(void)printf("%lc", (wint_t)*tabchar);
 	if (!ferror(stdout)) {
 		if (lp->fieldcnt <= fieldno || out_empty) {
 			if (empty != NULL)
@@ -535,7 +536,7 @@
  * Convert an output list argument "2.1, 1.3, 2.4" into an array of output
  * fields.
  */
-void
+static void
 fieldarg(char *option)
 {
 	u_long fieldno, filenum;
@@ -569,7 +570,7 @@
 	}
 }
 
-void
+static void
 obsolete(char **argv)
 {
 	size_t len;
@@ -654,7 +655,7 @@
 	}
 }
 
-void
+static void
 usage(void)
 {
 	(void)fprintf(stderr, "%s %s\n%s\n",

Added: trunk/usr.bin/join/tests/Makefile
===================================================================
--- trunk/usr.bin/join/tests/Makefile	                        (rev 0)
+++ trunk/usr.bin/join/tests/Makefile	2018-07-07 19:25:27 UTC (rev 11524)
@@ -0,0 +1,12 @@
+# $MidnightBSD$
+# $FreeBSD: stable/10/usr.bin/join/tests/Makefile 313488 2017-02-09 22:49:48Z ngie $
+
+TAP_TESTS_SH=	legacy_test
+
+FILESDIR=	${TESTSDIR}
+FILES=		regress.1.in
+FILES+=		regress.2.in
+FILES+=		regress.out
+FILES+=		regress.sh
+
+.include <bsd.test.mk>


Property changes on: trunk/usr.bin/join/tests/Makefile
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+MidnightBSD=%H
\ No newline at end of property
Added: svn:mime-type
## -0,0 +1 ##
+text/plain
\ No newline at end of property
Added: trunk/usr.bin/join/tests/legacy_test.sh
===================================================================
--- trunk/usr.bin/join/tests/legacy_test.sh	                        (rev 0)
+++ trunk/usr.bin/join/tests/legacy_test.sh	2018-07-07 19:25:27 UTC (rev 11524)
@@ -0,0 +1,7 @@
+#!/bin/sh
+# $FreeBSD: stable/10/usr.bin/join/tests/legacy_test.sh 263227 2014-03-16 08:04:06Z jmmv $
+# $MidnightBSD$
+
+SRCDIR="$(dirname "${0}")"; export SRCDIR
+
+m4 "${SRCDIR}/../regress.m4" "${SRCDIR}/regress.sh" | sh


Property changes on: trunk/usr.bin/join/tests/legacy_test.sh
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+MidnightBSD=%H
\ No newline at end of property
Added: svn:mime-type
## -0,0 +1 ##
+text/plain
\ No newline at end of property
Added: trunk/usr.bin/join/tests/regress.1.in
===================================================================
--- trunk/usr.bin/join/tests/regress.1.in	                        (rev 0)
+++ trunk/usr.bin/join/tests/regress.1.in	2018-07-07 19:25:27 UTC (rev 11524)
@@ -0,0 +1,4 @@
+!Name,Data1
+Foo,1
+Bar,2
+Baz,3


Property changes on: trunk/usr.bin/join/tests/regress.1.in
___________________________________________________________________
Added: mnbsd:nokeywords
## -0,0 +1 ##
+MidnightBSD=%H
\ No newline at end of property
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:mime-type
## -0,0 +1 ##
+text/plain
\ No newline at end of property
Added: trunk/usr.bin/join/tests/regress.2.in
===================================================================
--- trunk/usr.bin/join/tests/regress.2.in	                        (rev 0)
+++ trunk/usr.bin/join/tests/regress.2.in	2018-07-07 19:25:27 UTC (rev 11524)
@@ -0,0 +1,4 @@
+!Name,Data2
+Foo,Bar
+Baz,2
+Foobar,1


Property changes on: trunk/usr.bin/join/tests/regress.2.in
___________________________________________________________________
Added: mnbsd:nokeywords
## -0,0 +1 ##
+MidnightBSD=%H
\ No newline at end of property
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:mime-type
## -0,0 +1 ##
+text/plain
\ No newline at end of property
Added: trunk/usr.bin/join/tests/regress.out
===================================================================
--- trunk/usr.bin/join/tests/regress.out	                        (rev 0)
+++ trunk/usr.bin/join/tests/regress.out	2018-07-07 19:25:27 UTC (rev 11524)
@@ -0,0 +1,5 @@
+!Name,Data1,Data2
+Foo,1,Bar
+Bar,2,(unknown)
+Baz,3,2
+Foobar,(unknown),1


Property changes on: trunk/usr.bin/join/tests/regress.out
___________________________________________________________________
Added: mnbsd:nokeywords
## -0,0 +1 ##
+MidnightBSD=%H
\ No newline at end of property
Added: trunk/usr.bin/join/tests/regress.sh
===================================================================
--- trunk/usr.bin/join/tests/regress.sh	                        (rev 0)
+++ trunk/usr.bin/join/tests/regress.sh	2018-07-07 19:25:27 UTC (rev 11524)
@@ -0,0 +1,10 @@
+# $MidnightBSD$
+# $FreeBSD: stable/10/usr.bin/join/tests/regress.sh 263227 2014-03-16 08:04:06Z jmmv $
+
+echo 1..1
+
+REGRESSION_START($1)
+
+REGRESSION_TEST_ONE(`join -t , -a1 -a2 -e "(unknown)" -o 0,1.2,2.2 ${SRCDIR}/regress.1.in ${SRCDIR}/regress.2.in')
+
+REGRESSION_END()


Property changes on: trunk/usr.bin/join/tests/regress.sh
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+MidnightBSD=%H
\ No newline at end of property
Added: svn:mime-type
## -0,0 +1 ##
+text/plain
\ No newline at end of property


More information about the Midnightbsd-cvs mailing list