From db@db.net  Tue May 31 11:57:03 2005
Return-Path: <db@db.net>
Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125])
	by hub.freebsd.org (Postfix) with ESMTP id AA2AC16A41C
	for <freebsd-gnats-submit@freebsd.org>; Tue, 31 May 2005 11:57:03 +0000 (GMT)
	(envelope-from db@db.net)
Received: from heceta.db.net (heceta.db.net [142.46.199.182])
	by mx1.FreeBSD.org (Postfix) with ESMTP id 692A943D1F
	for <freebsd-gnats-submit@freebsd.org>; Tue, 31 May 2005 11:57:03 +0000 (GMT)
	(envelope-from db@db.net)
Received: from heceta.db.net
	([142.46.199.182] helo=localhost ident=mailnull)
	by heceta.db.net with esmtp (Exim 4.24; FreeBSD 4.8)
	id 1Dd5Nl-000IES-KV
	for freebsd-gnats-submit@freebsd.org; Tue, 31 May 2005 07:58:05 -0400
Received: from localhost.dbn ([127.0.0.1] helo=night.db.net)
	by night.db.net with esmtp (Exim 4.50 (FreeBSD))
	id 1Dd5NW-0008Uh-R7
	for FreeBSD-gnats-submit@freebsd.org; Tue, 31 May 2005 07:57:50 -0400
Received: (from db@localhost)
	by night.db.net (8.13.3/8.13.1/Submit) id j4VBvmhq032654;
	Tue, 31 May 2005 07:57:48 -0400 (EDT)
	(envelope-from db)
Message-Id: <200505311157.j4VBvmhq032654@night.db.net>
Date: Tue, 31 May 2005 07:57:48 -0400 (EDT)
From: Diane Bruce <db@db.net>
Reply-To: Diane Bruce <db@night.db.net>
To: FreeBSD-gnats-submit@freebsd.org
Cc:
Subject: lam accepts -P but not -p
X-Send-Pr-Version: 3.113
X-GNATS-Notify:

>Number:         81709
>Category:       bin
>Synopsis:       [patch] lam(1) accepts -P but not -p
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Tue May 31 12:00:16 GMT 2005
>Closed-Date:    
>Last-Modified:  Sat Jan 16 20:58:54 UTC 2010
>Originator:     Diane Bruce
>Release:        FreeBSD 5.4-RELEASE-p1 i386
>Organization:
Very unorganized.
>Environment:
System: FreeBSD night.db.net 5.4-RELEASE-p1 FreeBSD 5.4-RELEASE-p1 #7: Thu May 19 07:07:49 EDT 2005 root@:/usr/src/sys/i386/compile/NIGHT i386


>Description:
	lam honours the -P flag but not the -p flag, which should
	do exactly the same thing.

>How-To-Repeat:
echo A > f1
echo B > f2
echo C >> f2
lam -P 1.1 f1 f2
AB
 C
lam -p 1.1 f1 f2
AB
C

>Fix:

This patch will fix it, but it really should be rewritten.

PATCH tested


--- lam.c.orig	Tue May 31 07:03:26 2005
+++ lam.c	Tue May 31 06:57:40 2005
@@ -120,7 +120,8 @@
 			else if ((ip->fp = fopen(p, "r")) == NULL) {
 				err(1, "%s", p);
 			}
-			ip->pad = P;
+			if(!ip->pad)
+				ip->pad = P;
 			if (!ip->sepstring)
 				ip->sepstring = (S ? (ip-1)->sepstring : "");
 			if (!ip->format)

>Release-Note:
>Audit-Trail:
>Unformatted:
