From 5163058672a75719473a7e929b05ff347bd4b54a Mon Sep 17 00:00:00 2001 From: hubertf Date: Tue, 12 Sep 2006 21:56:43 +0000 Subject: [PATCH] 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. --- libexec/getNAME/getNAME.c | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/libexec/getNAME/getNAME.c b/libexec/getNAME/getNAME.c index de3b4d7763c6..d9f1295c24f0 100644 --- a/libexec/getNAME/getNAME.c +++ b/libexec/getNAME/getNAME.c @@ -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';