[Dnsmasq-discuss] space two point eighty one

Geert Stappers stappers at stappers.nl
Thu Mar 5 21:05:11 GMT 2020


On Thu, Mar 05, 2020 at 09:46:21PM +0100, Geert Stappers wrote:
> Previous-Subject: Re: [Dnsmasq-discuss] Announce: dnsmasq-2.81rc1
> In-Reply-To: <46B01EF6-DF07-44ED-86BA-CCBD2EFDB368 at darbyshire-bryant.me.uk>
> On Tue, Mar 03, 2020 at 09:07:15AM +0000, Kevin 'ldir' Darbyshire-Bryant wrote:
> > On 3 Mar 2020, at 06:31, Geert Stappers <stappers at stappers.nl> wrote:
> > > On Mon, Mar 02, 2020 at 10:39:26PM +0000, Simon Kelley wrote:
> > >> 
> > >> ... and let me know ... if there are any loose ends I missed.
> > >> 
> > > 
> > > In http://lists.thekelleys.org.uk/pipermail/dnsmasq-discuss/2020q1/013757.html
> > > is
> > >   int count, new;
> > > -  struct dhcp_config *config, *candidate;
> > > +  struct dhcp_config *config, *candidate;
> > >   struct hwaddr_config *conf_addr;
> > 
> > Not sure I understand the relevance Geert but as is common with these
> > sort of non obvious replacements, there’s a ‘rogue’ white space
> > at the end of the replaced line which is removed by its replacement.
>  
> Yes, that is the problem:  rogue white space is considered irrelevant
> 
> I plea for removal of unneeded ' ' and '	'.
> 
> That removal can be done with:
> 
> sed --in-place -e '${/^ *$/d;}' src/*.c ; git diff | wc
> sed --in-place -e '${/^ *$/d;}' src/*.c ; git diff | wc
> sed --in-place -e '${/^ *$/d;}' src/*.c ; git diff | wc
> sed --in-place -e '${/^ *$/d;}' src/*.c ; git diff | wc
> sed --in-place -e '${/^ *$/d;}' src/*.c ; git diff | wc
> sed --in-place -e '${/^ *$/d;}' src/*.c ; git diff | wc
> sed --in-place -e '${/^ *$/d;}' src/*.c ; git diff | wc

Numbers from output of `wc` increased.


> sed --in-place -e '${/^ *$/d;}' src/*.c ; git diff | wc
> sed --in-place -e '${/^ *$/d;}' src/*.c ; git diff | wc

Output of `wc` is stable.

At this point you probably want to do `git diff`
and will see that trailing-space-only-lines are removed.


> sed --in-place -e 's/^[ \t]*$//' src/*.c ; git diff | wc

Lines that had only spaces or tabs got that white space removed.

 
> sed --in-place -e 's/^[ \t]*$//' src/*.c ; git diff | wc
> sed --in-place -e 's/^[ \t]*$//' src/*.c ; git diff | wc

Output of `wc` is stable.

`git diff` is huge, almost 22000 lines.  Yes, a huge clean-up.


I love to see that in the 2.81 release of dnsmasq.

 git commit -am "Removed useless whitespace" --author "Geert Stappers <stappers at stappers.nl>"



Regards
Geert Stappers
-- 
Silence is hard to parse
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://lists.thekelleys.org.uk/pipermail/dnsmasq-discuss/attachments/20200305/5055bfbb/attachment.sig>


More information about the Dnsmasq-discuss mailing list