[GRASS5] [bug #973] (grass) rgbcolors - d.save

Glynn Clements glynn.clements at virgin.net
Sun Mar 24 14:23:37 EST 2002


Glynn Clements wrote:

> > I am using rgb-colors in d.area, i.e:
> > GRASS:~ > d.area map=vaf fillcolor="rgb(100 147  237)" linecolor=none 
> > catnum=3101
> > 
> > Which works just fine.
> > 
> > But then I do a d.save;
> > GRASS:~ > d.save -o
> > d.area map=vaf fillcolor=rgb(100 147  237) linecolor=none catnum=3101  # 1
> > 
> > As you see, the "s are missing, if I try to reuse the line, I'll get:GRASS:~ 
> > > d.area map=vaf fillcolor=rgb(100 147  237) linecolor=none catnum=3101
> >  # 1
> > bash: syntax error near unexpected token `fillcolor=rgb(1'
> > 
> > It is of cource no really big deal to put in the "s, but i think d.save 
> > should have done it for me...
> 
> Ultimately it's G_recreate_command() which needs to be fixed[1]. You
> can get it 99% right by just putting single quotes around each
> argument; to get it completely right, you also have to replace any
> single quotes with "'\''" (quote-backslash-quote-quote).
> 
> [1] I'll look at it at some point.

I've changed G_recreate_command() to quote any options which contain
any characters other than alphanumerics (according to isalnum()) and
the symbols "+,-./:=_".

For d.area, it's somewhat moot, as this is disabled by default in the
CVS head. It still matters for other commands (certain shell
metacharacters, e.g. "$", are legal in map names).

-- 
Glynn Clements <glynn.clements at virgin.net>



More information about the grass-dev mailing list