From ca@sendmail.com  Sat Dec 18 19:10:16 1999
Return-Path: <ca@sendmail.com>
Received: from katroo.Sendmail.COM (katroo.Sendmail.COM [206.189.75.90])
	by hub.freebsd.org (Postfix) with ESMTP id 96159150E2
	for <FreeBSD-gnats-submit@freebsd.org>; Sat, 18 Dec 1999 19:10:11 -0800 (PST)
	(envelope-from ca@sendmail.com)
Received: from wiz.Sendmail.COM (wiz.Sendmail.COM [10.210.100.97])
	by katroo.Sendmail.COM (8.9.3/8.9.3) with ESMTP id TAA14086
	for <FreeBSD-gnats-submit@freebsd.org>; Sat, 18 Dec 1999 19:10:11 -0800 (PST)
Received: (from ca@localhost)
	by wiz.Sendmail.COM (8.10.0.Beta2/8.10.0.Beta2) id dBJ3ABa87499;
	Sat, 18 Dec 1999 19:10:11 -0800 (PST) (with TLS:::: AUTH::)
Message-Id: <199912190310.dBJ3ABa87499@wiz.Sendmail.COM>
Date: Sat, 18 Dec 1999 19:10:11 -0800 (PST)
From: ca+freebsd@zardoc.endmail.org
Sender: ca@sendmail.com
Reply-To: ca+freebsd@zardoc.endmail.org
To: FreeBSD-gnats-submit@freebsd.org
Subject: some enhancements for uudecode
X-Send-Pr-Version: 3.2

>Number:         15555
>Category:       misc
>Synopsis:       some enhancements for uudecode
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-bugs
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Sat Dec 18 19:20:01 PST 1999
>Closed-Date:    Wed Mar 28 11:19:22 PST 2001
>Last-Modified:  Wed Mar 28 11:19:31 PST 2001
>Originator:     Claus Assmann
>Release:        FreeBSD 3.2-RELEASE i386
>Organization:
Endmail, Org.
>Environment:

	Any(?) FreeBSD version (3.2, 3.3)

>Description:

	uudecode isn't very helpful in it's error reports:
	It doesn't mention the source file if a destination file
	is to be overridden, nor does it mention the line where
	an out-of-range characters occurs.

>How-To-Repeat:

	[Not provided]

>Fix:
	
	Patch:

--- /usr/src/usr.bin/uudecode/uudecode.c	Sun Aug 29 08:34:23 1999
+++ uudecode.c	Sat Dec 18 19:47:25 1999
@@ -97,7 +97,6 @@
         argc -= optind;
         argv += optind;
 
-			
 	if (*argv) {
 		rval = 0;
 		do {
@@ -141,11 +140,10 @@
 	struct passwd *pw;
 	register int n;
 	register char ch, first, *p;
-	int mode, n1;
+	int mode, n1, l;
 	char buf[MAXPATHLEN];
 	char buffn[MAXPATHLEN]; /* file name buffer */
 
-	
 	/* search for header line */
 	do {
 		if (!fgets(buf, sizeof(buf), stdin)) {
@@ -198,7 +196,8 @@
 
 	else {
 		if (iflag && !access(buf, F_OK))
-			(void)fprintf(stderr, "not overwritten: %s\n", buf);
+			(void)fprintf(stderr, "%s: not overwritten: %s\n",
+				filename, buf);
 		if (!freopen(buf, "w", stdout) ||
 		    fchmod(fileno(stdout), mode&0666)) {
 			warn("%s: %s", buf, filename);
@@ -208,7 +207,7 @@
 	strcpy(buffn, buf); /* store file name from header line */
 
 	/* for each input line */
-	for (;;) {
+	for (l = 0;; l++) {
 		if (!fgets(p = buf, sizeof(buf), stdin)) {
 			warnx("%s: short file", filename);
 			return(1);
@@ -220,8 +219,8 @@
 #define OUT_OF_RANGE \
 {	\
     warnx( \
-"\n\tinput file: %s\n\tencoded file: %s\n\tcharacter out of range: [%d-%d]", \
- 	filename, buffn, 1 + ' ', 077 + ' ' + 1); \
+"\n\tinput file: %s\n\tencoded file: %s\n\tcharacter out of range: [%d-%d] at %d", \
+ 	filename, buffn, 1 + ' ', 077 + ' ' + 1, l); \
         return(1); \
 }
 

>Release-Note:
>Audit-Trail:

From: Jean-Marc Zucconi <jmz@FreeBSD.ORG>
To: ca+freebsd@zardoc.endmail.org
Cc: FreeBSD-gnats-submit@FreeBSD.ORG
Subject: Re: misc/15555: some enhancements for uudecode
Date: Mon, 20 Dec 1999 02:50:38 +0100 (MET)

 >>>>> freebsd  writes:
 
  >> Description:
 
  > 	uudecode isn't very helpful in it's error reports:
  > 	It doesn't mention the source file if a destination file
  > 	is to be overridden, nor does it mention the line where
  > 	an out-of-range characters occurs.
 
 But your patch does not print the exact line number in the file, only
 an offset from the 'begin' line. It does not help very much when the
 input file contains several uuencoded files.
 
 Jean-Marc
 
 -- 
  Jean-Marc Zucconi                    PGP Key: finger jmz@FreeBSD.ORG
 
State-Changed-From-To: open->closed 
State-Changed-By: phk 
State-Changed-When: Wed Mar 28 11:19:22 PST 2001 
State-Changed-Why:  
Antique PR. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=15555 
>Unformatted:
