Date: Sat, 18 Dec 1999 19:10:11 -0800 (PST) From: ca+freebsd@zardoc.endmail.org To: FreeBSD-gnats-submit@freebsd.org Subject: misc/15555: some enhancements for uudecode Message-ID: <199912190310.dBJ3ABa87499@wiz.Sendmail.COM>
next in thread | raw e-mail | index | archive | help
>Number: 15555 >Category: misc >Synopsis: some enhancements for uudecode >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: change-request >Submitter-Id: current-users >Arrival-Date: Sat Dec 18 19:20:01 PST 1999 >Closed-Date: >Last-Modified: >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: >Unformatted: To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-bugs" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199912190310.dBJ3ABa87499>