[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: sed : * final newline
From: |
Bonzini |
Subject: |
Re: sed : * final newline |
Date: |
Wed, 9 Jul 2003 11:42:00 +0200 |
There is an additional solution, even easier: always output a new-line before a
line
following a line without a new-line.
That is
static bool pre_newline = false;
if (pre_newline)
fwrite ("\n", 1, 1, stdout);
...
pre_newline = !chomped;
(more or less -- there's some complication regarding `w' files, but that's the
idea)
|_ _ _ __
|_)(_)| ),'
------- '---