lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date:	Tue, 13 Mar 2007 15:16:48 +0100
From:	Arnaud Giersch <arnaud.giersch@...e.fr>
To:	"H. Peter Anvin" <hpa@...or.com>
Cc:	Andrew Morton <akpm@...l.org>,
	Linux Kernel Mailing List <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] cleanfile: a script to clean up stealth whitespace

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
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ