[GRASS-dev] do not get debug messages in 63-cvs

Martin Landa landa.martin at gmail.com
Sat Nov 11 07:54:03 EST 2006


Hi,

2006/11/10, Hamish <hamish_nospam at yahoo.com>:

[snip]

> Ah I see,
>
> the fn that reads .grassrc6 (lib/gis/env.c) is now calling G_getl2(),
> and G_getl2() calls G_debug(), which needs a value from .grassrc6.
>
> Do we have to worry about .grassrc6 getting DOS newlines in it?
> (user shouldn't be copying that between systems and should not be
> editing it)
> -> back to using G_getl()

not sure, on the other hand it is always better to take care about
various newlines...

> Does G_getl2() really need to call G_debug? I don't think so, the module
> that calls it can add G_debug(5, "input line=[]", buff); if they want
> that info.
>
> --> I suggest removing G_debug() from G_getl2() altogether.

That's the issue (for me), is there any reason why G_getl2() calls
G_debug() [G_getl() does not call G_debug()]. These two functions
(i.e. G_getl() and G_getl2()) are very similar (the second one only
cares about various newlines). So we should remove G_debug() calling
from G_getl2() or similarly to add G_debug () to G_getl().

>From simple point of view I also suggest *removing* G_debug() from G_getl2().

Martin

>
> Martin's patch fixes this case, but we would need to always audit env.c
> and everything it calls, and everything those calls call, to check it
> doesn't have any g.gisenv reqs.. :(
>
>
> Index: lib/gis/getl.c
> ===================================================================
> RCS file: /home/grass/grassrepository/grass6/lib/gis/getl.c,v
> retrieving revision 2.4
> diff -u -r2.4 getl.c
> --- lib/gis/getl.c      9 Feb 2006 03:08:56 -0000       2.4
> +++ lib/gis/getl.c      5 Nov 2006 10:18:48 -0000
> @@ -82,7 +82,8 @@
>      }
>      buf[i] = '\0';
>
> -    G_debug ( 4, "G_getl2: ->%s<-", buf );
> +    if (G__getenv ("DEBUG"))
> +       G_debug ( 4, "G_getl2: ->%s<-", buf );
>
>      return ret;
>  }
>
>
>
> Hamish
>


-- 
Martin Landa <landa.martin at gmail.com> * http://gama.fsv.cvut.cz/~landa *




More information about the grass-dev mailing list