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 for Android: free password hash cracker in your pocket
[<prev] [next>] [day] [month] [year] [list]
Date:	Fri, 10 Oct 2014 16:20:46 -0700
From:	Andi Kleen <andi@...stfloor.org>
To:	mmarek@...e.cz
Cc:	linux-kernel@...r.kernel.org, linux-kbuild@...r.kernel.org,
	Andi Kleen <ak@...ux.intel.com>, hpa@...or.com
Subject: [PATCH] kbuild: Fix cleanpatch to always replace leading space with tab

From: Andi Kleen <ak@...ux.intel.com>

If you have something like

<sp><sp><sp><sp><sp><sp><sp><sp>blabla

in a patch cleanpatch does not replace the spaces with tabs.
That is because it only handles space in front of tab.

But it's more convenient if it also replaces space with tabs,
even if there is no tab at all, as that is what checkpatch
and other pedants expect.

Cc: hpa@...or.com
Signed-off-by: Andi Kleen <ak@...ux.intel.com>
---
 scripts/cleanpatch | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/scripts/cleanpatch b/scripts/cleanpatch
index 9680d03..d14aac9 100755
--- a/scripts/cleanpatch
+++ b/scripts/cleanpatch
@@ -39,6 +39,10 @@ sub clean_space_tabs($)
 	} elsif ($c eq " ") {
 	    $nsp++;
 	} else {
+	    while ($nsp >= 8) {
+	        $lo .= "\t";
+		$nsp -= 8;
+	    }
 	    $lo .= " " x $nsp;
 	    $pos += $nsp;
 	    $nsp = 0;
-- 
1.9.3

--
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