[GRASS-dev] g.list: extra whitespace issue

Paul Kelly paul-grass at stjohnspoint.co.uk
Sun Mar 2 13:30:15 EST 2008


On Mon, 3 Mar 2008, Ivan Shmakov wrote:

>>>>>> Ivan Shmakov <ivan at theory.asu.ru> writes:
>>>>>> Ivan Shmakov <ivan at theory.asu.ru> writes:
>
> IS> [...]
>
> >> As for the padding problem, I believe that a more generic solution
> >> should be implemented.
>
> > Such as the following (rather obscure, though actually obvious)
> > one.
>
> [...]
>
> 	Since there were no objections, and since the extra whitespace
> 	may trigger extra linebreaks in the W32 ``console'' window:
>
> $ g.list
> bar					baz
>
> foo					qux
>
> ...
> $
>
> 	I've now committed the change:

Thanks Ivan. The orginal code was mine (a "DIY" solution), and I was aware 
of the problem with the ugly linebreaks on Windows, but hadn't yet 
investigated it further. FWIW I thought no space after the last item on 
a line, rather than no no space when there is only one item on a line, 
was the obvious course of action to pursue, but I'm sure the code from GNU 
ls achieves the same even better than hacking my code would.

Paul


More information about the grass-dev mailing list