Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 22 May 1996 09:38:56 +0200 (MET DST)
From:      Thomas Gellekum <thomas@ghpc8.ihf.rwth-aachen.de>
To:        bugs@freebsd.org
Subject:   ed(1) output on stderr or stdout?
Message-ID:  <199605220738.JAA13206@ghpc6.ihf.rwth-aachen.de>

next in thread | raw e-mail | index | archive | help
Moin moin,

some of the tests in the pdksh port failed. Michael Rendell, the
current maintainer of pdksh, told me the following:

>     history-ed-1..3
> 	FreeBSD's ed writes the byte counts to standard error instead
> 	of standard output.  Most eds write it to stdout (which is what
> 	posix says it should do).  Again, I can't do much to fix this...

The following patch fixes this:

--- bin/ed/io.c.orig	Tue May 21 19:23:38 1996
+++ bin/ed/io.c	Tue May 21 19:52:49 1996
@@ -58,7 +58,7 @@
 		sprintf(errmsg, "cannot close input file");
 		return ERR;
 	}
-	fprintf(stderr, !scripted ? "%lu\n" : "", size);
+	fprintf(stdout, !scripted ? "%lu\n" : "", size);
 	return current_addr - n;
 }
 
@@ -173,7 +173,7 @@
 		sprintf(errmsg, "cannot close output file");
 		return ERR;
 	}
-	fprintf(stderr, !scripted ? "%lu\n" : "", size);
+	fprintf(stdout, !scripted ? "%lu\n" : "", size);
 	return n ? m - n + 1 : 0;
 }
 
I'd like to commit this if there are no objections.

tg



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199605220738.JAA13206>