From: Arnaud Giersch <arnaud.giersch@free.fr>
To: "H. Peter Anvin" <hpa@zytor.com>
Cc: Andrew Morton <akpm@osdl.org>,
Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] cleanfile: a script to clean up stealth whitespace
Date: Tue, 13 Mar 2007 15:16:48 +0100 [thread overview]
Message-ID: <87abyh1b5b.fsf@groumpf.homeip.net> (raw)
In-Reply-To: <200703121920.l2CJK24N008104@tazenda.hos.anvin.org> (H. Peter Anvin's message of "Mon, 12 Mar 2007 12:16:30 -0700")
Lundi 12 mars 2007, vers 20:16:30 (+0100), H. Peter Anvin a écrit:
> This script cleans up various classes of stealth whitespace. In
> particular, it cleans up:
>
> - Whitespace (spaces or tabs)before newline;
> - DOS line endings (CR before LF);
> - Space before tab (spaces are deleted or converted to tabs);
> - Empty lines at end of file.
What about checking for a newline at end of file? Something like:
[...]
> + if ($is_binary) {
> + print STDERR "$name: $f: binary file\n";
> + next;
> + }
# Add a newline at end of file, if needed.
seek(FILE, -1, 2);
if (read(FILE, $last_char, 1) == 1 && $last_char ne "\n") {
seek(FILE, 0, 2);
print FILE "\n";
}
> + seek(FILE, 0, 0);
> +
> + $in_bytes = 0;
> + $out_bytes = 0;
> + $blank_bytes = 0;
[...]
Regards,
Arnaud Giersch
prev parent reply other threads:[~2007-03-13 14:17 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-03-12 19:16 [PATCH] cleanfile: a script to clean up stealth whitespace H. Peter Anvin
2007-03-13 6:14 ` Andrew Morton
2007-03-13 5:33 ` H. Peter Anvin
2007-03-13 5:37 ` H. Peter Anvin
2007-03-13 14:16 ` Arnaud Giersch [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87abyh1b5b.fsf@groumpf.homeip.net \
--to=arnaud.giersch@free.fr \
--cc=akpm@osdl.org \
--cc=hpa@zytor.com \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox