Re: [PATCH] cleanfile: a script to clean up stealth whitespace

!MAILaRCHIVE_VOTE_RePLACE
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: H. Peter Anvin <hpa@...>
Cc: Andrew Morton <akpm@...>, Linux Kernel Mailing List <linux-kernel@...>
Date: Tuesday, March 13, 2007 - 10:16 am

Lundi 12 mars 2007, vers 20:16:30 (+0100), H. Peter Anvin a écrit:


What about checking for a newline at end of file?  Something like:

[...]


    # 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";
    }


[...]

Regards,
        Arnaud Giersch
-
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[PATCH] cleanfile: a script to clean up stealth whitespace, H. Peter Anvin, (Mon Mar 12, 3:16 pm)
Re: [PATCH] cleanfile: a script to clean up stealth whitespace, Arnaud Giersch, (Tue Mar 13, 10:16 am)