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] [thread-next>] [day] [month] [year] [list]
Message-Id: <E1HP9kv-0002tC-RS@flower>
Date:	Thu, 8 Mar 2007 04:57:29 +0100
From:	Oleg Verych <olecom@...wer.upol.cz>
To:	Andrew Morton <akpm@...ux-foundation.org>, bryan.wu@...log.com
Cc:	Jean Delvare <khali@...ux-fr.org>,
	Alexey Dobriyan <adobriyan@...il.com>,
	Sonic Zhang <sonic.adi@...il.com>,
	Mike Frysinger <vapier.adi@...il.com>,
	linux-kernel@...r.kernel.org, mhfan@...c.edu
Subject: trailing whitespace killing (Re: [PATCH -mm] Blackfin: blackfin i2c driver)

> From: Andrew Morton
> Newsgroups: gmane.linux.kernel
> Subject: Re: [PATCH -mm] Blackfin: blackfin i2c driver
> Date: Tue, 6 Mar 2007 23:45:29 -0800
[]
> On Wed, 07 Mar 2007 15:39:27 +0800 "Wu, Bryan" <bryan.wu@...log.com> wrote:
>
>> Thanks a lot, could you please give me a script just to kill this
>> whitespace? So I can do it before sending you patches.
>
>
> Is pretty simple:
>
> #!/bin/sh
> #
> # Strip any trailing whitespace which a unified diff adds.
> #
>
> strip1()
> {
> 	TMP=$(mktemp /tmp/XXXXXX)
> 	cp $1 $TMP
> 	sed -e '/^+/s/[ 	]*$//' < $TMP > $1
> 	rm $TMP
> }
>
> for i in $*
> do
> 	strip1 $i
> done
>
>
> that'll be in
> http://www.zip.com.au/~akpm/linux/patches/patch-scripts-0.20/patch-scripts-0.20.tar.gz
> too

It doesn't work for me. Maybe i can't understand what you are trying to
do, anyway.

General suggestion is can be:

   sed -e 's_[ \t]*$__'

(i.e any line on stdin with space/tab mixed tails is stripped on stdout)

You can use it as wrapper for diff, sending patch bombs, etc.
(very nice with pipes):

shell$ diff -Npu2 old new | sed -e 's_[ \t]*$__' > patch.diff
shell$ < patch-set.mbox sed -e 's_[ \t]*$__' | formail -s /usr/sbin/sendmail -bm -t 

similar in scripts; quilt (patch sets manager) notices about them.
____
-
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