Index: usr.bin/comm/comm.c =================================================================== --- usr.bin/comm/comm.c (revision 200295) +++ usr.bin/comm/comm.c (working copy) @@ -163,7 +163,7 @@ main(int argc, char *argv[]) if (!comp) { read1 = read2 = 1; if (col3 != NULL) - (void)printf("%ls%ls", col3, line1); + (void)printf("%ls%ls\n", col3, line1); continue; } @@ -172,12 +172,12 @@ main(int argc, char *argv[]) read1 = 1; read2 = 0; if (col1 != NULL) - (void)printf("%ls%ls", col1, line1); + (void)printf("%ls%ls\n", col1, line1); } else { read1 = 0; read2 = 1; if (col2 != NULL) - (void)printf("%ls%ls", col2, line2); + (void)printf("%ls%ls\n", col2, line2); } } exit(0); @@ -190,17 +190,15 @@ getline(wchar_t *buf, size_t *buflen, FI wint_t ch; bufpos = 0; - do { - if ((ch = getwc(fp)) != WEOF) { - if (bufpos + 2 >= *buflen) { - *buflen = *buflen * 2; - buf = reallocf(buf, *buflen * sizeof(*buf)); - if (buf == NULL) - return (NULL); - } - buf[bufpos++] = ch; + while ((ch = getwc(fp)) != WEOF && ch != '\n') { + if (bufpos + 2 >= *buflen) { + *buflen = *buflen * 2; + buf = reallocf(buf, *buflen * sizeof(*buf)); + if (buf == NULL) + return (NULL); } - } while (ch != WEOF && ch != '\n'); + buf[bufpos++] = ch; + } if (bufpos + 1 != *buflen) buf[bufpos] = '\0'; @@ -212,7 +210,7 @@ show(FILE *fp, const char *fn, const wch { do { - (void)printf("%ls%ls", offset, buf); + (void)printf("%ls%ls\n", offset, buf); } while ((buf = getline(buf, buflen, fp)) != NULL); if (ferror(fp)) err(1, "%s", fn); Index: tools/regression/usr.bin/comm/regress.01.out =================================================================== --- tools/regression/usr.bin/comm/regress.01.out (revision 0) +++ tools/regression/usr.bin/comm/regress.01.out (revision 0) @@ -0,0 +1,2 @@ +a b +e f g Property changes on: tools/regression/usr.bin/comm/regress.01.out ___________________________________________________________________ Added: fbsd:nokeywords + regress.00a.in Index: tools/regression/usr.bin/comm/regress.01a.in =================================================================== --- tools/regression/usr.bin/comm/regress.01a.in (revision 0) +++ tools/regression/usr.bin/comm/regress.01a.in (revision 0) @@ -0,0 +1,5 @@ +a b +c d +e f +e f g +h i Property changes on: tools/regression/usr.bin/comm/regress.01a.in ___________________________________________________________________ Added: fbsd:nokeywords + regress.00a.in Index: tools/regression/usr.bin/comm/regress.00b.in =================================================================== --- tools/regression/usr.bin/comm/regress.00b.in (revision 0) +++ tools/regression/usr.bin/comm/regress.00b.in (revision 0) @@ -0,0 +1,2 @@ +a b +e f g Property changes on: tools/regression/usr.bin/comm/regress.00b.in ___________________________________________________________________ Added: fbsd:nokeywords + regress.00a.in Index: tools/regression/usr.bin/comm/regress.01b.in =================================================================== --- tools/regression/usr.bin/comm/regress.01b.in (revision 0) +++ tools/regression/usr.bin/comm/regress.01b.in (revision 0) @@ -0,0 +1,2 @@ +a b +e f g Property changes on: tools/regression/usr.bin/comm/regress.01b.in ___________________________________________________________________ Added: fbsd:nokeywords + regress.00a.in Index: tools/regression/usr.bin/comm/regress.sh =================================================================== --- tools/regression/usr.bin/comm/regress.sh (revision 0) +++ tools/regression/usr.bin/comm/regress.sh (revision 0) @@ -0,0 +1,12 @@ +# $FreeBSD$ + +LC_ALL=C; export LC_ALL + +echo 1..2 + +REGRESSION_START($1) + +REGRESSION_TEST(`00', `comm -12 regress.00a.in regress.00b.in') +REGRESSION_TEST(`01', `comm -12 regress.01a.in regress.01b.in') + +REGRESSION_END() Property changes on: tools/regression/usr.bin/comm/regress.sh ___________________________________________________________________ Added: svn:keywords + FreeBSD=%H Index: tools/regression/usr.bin/comm/regress.t =================================================================== --- tools/regression/usr.bin/comm/regress.t (revision 0) +++ tools/regression/usr.bin/comm/regress.t (revision 0) @@ -0,0 +1,6 @@ +#!/bin/sh +# $FreeBSD$ + +cd `dirname $0` + +m4 ../regress.m4 regress.sh | sh Property changes on: tools/regression/usr.bin/comm/regress.t ___________________________________________________________________ Added: svn:keywords + FreeBSD=%H Index: tools/regression/usr.bin/comm/Makefile =================================================================== --- tools/regression/usr.bin/comm/Makefile (revision 0) +++ tools/regression/usr.bin/comm/Makefile (revision 0) @@ -0,0 +1,4 @@ +# $FreeBSD$ + +all: + @m4 ${.CURDIR}/../regress.m4 ${.CURDIR}/regress.sh | sh /dev/stdin ${.CURDIR} Property changes on: tools/regression/usr.bin/comm/Makefile ___________________________________________________________________ Added: svn:keywords + FreeBSD=%H Index: tools/regression/usr.bin/comm/regress.00a.in =================================================================== --- tools/regression/usr.bin/comm/regress.00a.in (revision 0) +++ tools/regression/usr.bin/comm/regress.00a.in (revision 0) @@ -0,0 +1,5 @@ +a b +c d +e f +e f g +h i Index: tools/regression/usr.bin/comm/regress.00.out =================================================================== --- tools/regression/usr.bin/comm/regress.00.out (revision 0) +++ tools/regression/usr.bin/comm/regress.00.out (revision 0) @@ -0,0 +1,2 @@ +a b +e f g Property changes on: tools/regression/usr.bin/comm/regress.00.out ___________________________________________________________________ Added: fbsd:nokeywords + regress.00a.in Index: tools/regression/usr.bin/Makefile =================================================================== --- tools/regression/usr.bin/Makefile (revision 200295) +++ tools/regression/usr.bin/Makefile (working copy) @@ -1,5 +1,5 @@ # $FreeBSD$ -SUBDIR= calendar file2c join jot m4 printf sed tr uudecode uuencode xargs lastcomm +SUBDIR= calendar comm file2c join jot m4 printf sed tr uudecode uuencode xargs lastcomm .include