summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoey Hess <joeyh@joeyh.name>2021-09-16 09:11:39 -0400
committerJoey Hess <joeyh@joeyh.name>2021-09-16 09:12:37 -0400
commitd3d4fc1c2bbfdc37c69cc894c532ac51cb134eb1 (patch)
treeaa4a25f196c72e6f107d83184651b0a877b43309
parent4e0a7d96bf944979d6eea3fc764dce1bb18779a2 (diff)
downloadmoreutils-d3d4fc1c2bbfdc37c69cc894c532ac51cb134eb1.tar.gz
chronic: With -v, flush stdout after printing "STDERR" header
Since that header is output to stdout, make sure it is output before outputting the actual stderr, so the header does not appear after the stderr. Thanks to Adam Sjøgren for reporting the problem and making the patch.
-rwxr-xr-xchronic2
-rw-r--r--debian/changelog2
2 files changed, 3 insertions, 1 deletions
diff --git a/chronic b/chronic
index e24e582..43e8693 100755
--- a/chronic
+++ b/chronic
@@ -89,8 +89,8 @@ else {
sub showout {
print "STDOUT:\n" if $opt_v;
print STDOUT $out;
- STDOUT->flush();
print "\nSTDERR:\n" if $opt_v;
+ STDOUT->flush();
print STDERR $err;
STDERR->flush();
print "\nRETVAL: ".($ret >> 8)."\n" if $opt_v;
diff --git a/debian/changelog b/debian/changelog
index 10f84a1..f9e4450 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -4,6 +4,8 @@ moreutils (0.66) UNRELEASED; urgency=medium
the terminal, don't read from stdin before opening the editor.
This allows eg: vipe | command
Thanks, Florian Pensec
+ * chronic: With -v, flush stdout after printing "STDERR" header.
+ Thanks, Adam Sjøgren
-- Joey Hess <id@joeyh.name> Thu, 04 Feb 2021 16:27:16 -0400