Hallo,
while testing r.quant, I found out, that r.quant is not able to parse
"help" input correctly, because last "\n" character of the input is not
being striped.
r.quant uses G_strip (lib/gis/strings.c) for this purpose, which strips
only " " and "\t" characters, but not "\n".
I prepared this patch for strings.c. Do you think, it could be applied?
Perhaps try G_chop() instead? I have (IIRC) changed a few of these already for Windows portability.
Sorry reading e-mail on the move and not able to check if somebody has replied already...
Paul
On Sun, 26 Nov 2006, Jachym Cepicky wrote:
Hallo,
while testing r.quant, I found out, that r.quant is not able to parse
"help" input correctly, because last "\n" character of the input is not
being striped.
r.quant uses G_strip (lib/gis/strings.c) for this purpose, which strips
only " " and "\t" characters, but not "\n".
I prepared this patch for strings.c. Do you think, it could be applied?
On Mon, Nov 27, 2006 at 04:13:27PM +0000, Paul Kelly wrote:
Perhaps try G_chop() instead? I have (IIRC) changed a few of these already
for Windows portability.
Sorry reading e-mail on the move and not able to check if somebody has
replied already...
Paul
On Sun, 26 Nov 2006, Jachym Cepicky wrote:
>Hallo,
>while testing r.quant, I found out, that r.quant is not able to parse
>"help" input correctly, because last "\n" character of the input is not
>being striped.
>
>r.quant uses G_strip (lib/gis/strings.c) for this purpose, which strips
>only " " and "\t" characters, but not "\n".
>
>I prepared this patch for strings.c. Do you think, it could be applied?
>
>Jachym
>--
>Jachym Cepicky
>e-mail: jachym.cepicky@centrum.cz
>URL: http://les-ejk.cz
>GPG: http://www.les-ejk.cz/pgp/jachym_cepicky-gpg.pub
>-----------------------------------------
>OFFICE:
>Department of Geoinformation Technologies
>Zemedelska 3
>613 00, Brno
>Czech Republick
>e-mail: xcepicky@node.mendelu.cz
>URL: http://mapserver.mendelu.cz
>Tel.: +420 545 134 514
>
while testing r.quant, I found out, that r.quant is not able to parse
"help" input correctly, because last "\n" character of the input is
not being striped.
r.quant uses G_strip (lib/gis/strings.c) for this purpose, which
strips only " " and "\t" characters, but not "\n".
I prepared this patch for strings.c. Do you think, it could be
applied?
just to note, please be very very careful when subtly changing the
behavior of core lib functions. it is likely this may subtly break many
modules in the process. (ie do so only if you are willing to perform a
full audit or it fixes a clear bug)
I added
G_chop(buff)
to raster/r.quant/read_rules.c
works nice