this bug's URL: http://intevation.de/rt/webrt?serial_num=973
-------------------------------------------------------------------------
Subject: rgbcolors - d.save
Platform: Linux/Intel
Linux distro: Homemade
linux cpu: AMD (K6, ...)
Xwindows version: Xfree 3.3.6
Xwindows manager: KDE 2.x
TclTk version: tcl/tk 8.3
grass downloaded at: Trento site
grass binary for platform: I compiled the sources myself
grass sources source: no, I got a source code package from the server
c compiler name: gcc
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...
Morten
-------------------------------------------- Managed by Request Tracker
Request Tracker wrote:
Subject: rgbcolors - d.save
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.
Also, this is a warning sign regarding the syntax. Even though the
issue is specifically addressed in the "NOTES" section of the d.area
manpage, I wouldn't be surprised if we get "bug" reports due to users
failing to quote the argument (there's already been one case of a user
attempting to use spaces in a multi-valued argument).
--
Glynn Clements <glynn.clements@virgin.net>
On Thu, Mar 21, 2002 at 08:02:28PM +0000, Glynn Clements wrote:
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.
Also, this is a warning sign regarding the syntax. Even though the
issue is specifically addressed in the "NOTES" section of the d.area
manpage, I wouldn't be surprised if we get "bug" reports due to users
failing to quote the argument (there's already been one case of a user
attempting to use spaces in a multi-valued argument).
Don't know if this problem would affect too many other modules, and
d.vect.area doesn't use rgb(num num num), recognizing the problem
with spaces.
--
Eric G. Miller <egm2@jps.net>
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@virgin.net>