[GRASS-dev] Re: g.rename consolidation

Glynn Clements glynn at gclements.plus.com
Fri Mar 2 02:17:29 EST 2007


Hamish wrote:

> Glynn Clements wrote:

> this little patch adds GRASS_MESSAGE_FORMAT=silent to error.c, but not
> for G_percent() as then it would need a global variable. Better to just
> put another getenv("GRASS_MESSAGE_FORMAT") and strcmp(,"silent") in
> percent.c and clicker.c? Anywhere else?

> --- lib/gis/error.c	22 Feb 2007 10:18:53 -0000	1.15
> +++ lib/gis/error.c	2 Mar 2007 05:31:28 -0000
> @@ -282,7 +282,8 @@
>  	    while (print_word(stderr,&w,&len,lead))
>  		    ;
>  
> -	    if ( (type != MSG) && isatty(fileno(stderr))) { /* Bell */
> +	    if ( (type != MSG) && isatty(fileno(stderr))
> +		    && (grass_info_format == G_INFO_FORMAT_STANDARD) ) { /* Bell */

This doesn't compile, as grass_info_format is local to
G_info_format(). Fix:

-		    && (grass_info_format == G_INFO_FORMAT_STANDARD) ) { /* Bell */
+		    && (G_info_format() == G_INFO_FORMAT_STANDARD) ) { /* Bell */

Although, technically it shouldn't be printing "\7" without checking
the terminal's termcap/terminfo entry.

[I'm not suggesting that it should actually do that; making libgis
depend upon libtermcap/libtinfo/lib[n]curses would be overkill. Having
the occasional ^G in the output is small fry compared to the string of
^H characters from G_percent().]

-- 
Glynn Clements <glynn at gclements.plus.com>




More information about the grass-dev mailing list