Handle .br - this makes processing of the netbsd-4

src/dist/bzip2/bzip2.1 file work:

Before:
	% getNAME /usr/cvs/src-4/dist/bzip2/bzip2.1
	bzip2, bunzip2 (1) - a block-sorting file compressor, v1.0.2 .br bzcat (1) - decompresses files to stdout .br bzip2recover (1) - recovers data from damaged bzip2 files

After:
	% getNAME /usr/cvs/src-4/dist/bzip2/bzip2.1
	bzip2, bunzip2 (1) - a block-sorting file compressor, v1.0.2
	bzcat (1) - decompresses files to stdout
	bzip2recover (1) - recovers data from damaged bzip2 files

Verified with code from src/share/man/man0 that nothing else was
broken by this change.
This commit is contained in:
hubertf 2006-09-12 21:56:43 +00:00
parent 747bc86364
commit 5163058672

View File

@ -1,4 +1,4 @@
/* $NetBSD: getNAME.c,v 1.24 2004/03/20 20:30:48 christos Exp $ */
/* $NetBSD: getNAME.c,v 1.25 2006/09/12 21:56:43 hubertf Exp $ */
/*-
* Copyright (c) 1997, Christos Zoulas. All rights reserved.
@ -37,7 +37,7 @@ __COPYRIGHT("@(#) Copyright (c) 1980, 1993\n\
#if 0
static char sccsid[] = "@(#)getNAME.c 8.1 (Berkeley) 6/30/93";
#else
__RCSID("$NetBSD: getNAME.c,v 1.24 2004/03/20 20:30:48 christos Exp $");
__RCSID("$NetBSD: getNAME.c,v 1.25 2006/09/12 21:56:43 hubertf Exp $");
#endif
#endif /* not lint */
@ -164,6 +164,7 @@ oldman(char *pathname, char *name)
size_t len, i, extlen;
size_t curlen = 0;
size_t newmaxlen;
size_t ocurlen = -1;
if (typeflag) {
(void)printf("%-60s\tOLD\n", pathname);
@ -200,6 +201,7 @@ oldman(char *pathname, char *name)
return;
}
again:
if (tocrc)
doname(name);
@ -215,6 +217,14 @@ oldman(char *pathname, char *name)
break;
if (line[1] == 'P' && line[2] == 'P')
break;
if (line[1] == 'b' && line[2] == 'r') {
if (intro)
split(linebuf, name);
else
(void)printf("%s\n", linebuf);
curlen = ocurlen;
goto again;
}
}
if (line[len - 1] == '\n') {
line[len - 1] = '\0';
@ -237,6 +247,7 @@ oldman(char *pathname, char *name)
if (i != 0)
linebuf[curlen++] = ' ';
(void)memcpy(&linebuf[curlen], line, len);
ocurlen = curlen;
curlen += len;
linebuf[curlen] = '\0';