[GRASS-dev] Re: [GRASS GIS] #528: wxGUI cmd: r.mapcalc fails

GRASS GIS trac at osgeo.org
Sat Mar 14 19:25:31 EDT 2009

#528: wxGUI cmd: r.mapcalc fails
  Reporter:  neteler   |       Owner:  grass-dev at lists.osgeo.org
      Type:  defect    |      Status:  new                      
  Priority:  critical  |   Milestone:  6.4.0                    
 Component:  wxGUI     |     Version:  svn-develbranch6         
Resolution:            |    Keywords:                           
  Platform:  All       |         Cpu:  All                      
Comment (by glynn):

 Replying to [comment:10 cmbarton]:

 > I'm not sure we're talking about exactly the same thing.
 > Currently the very simple command processor does not require quotes
 around the main r.mapcalc argument. This is also the case in other
 settings, including the TclTk command processor. Quotes are not required
 around the main r.mapcalc argument in the terminal on my Mac either. That
 was the original issue. I don't see this, in and of itself as a defect--
 though I suppose others might disagree.

 This isn't true in 7.0, where r.mapcalc uses the parser. The 6.x r.mapcalc
 is a special case, as it simply concatenates all of its arguments,
 separated by spaces, which eliminates the need for quoting. Any command
 which uses the parser requires quoting (or escaping) if an argument
 contains spaces.

 > Spaces, in and of themselves are not a problem in the command processor.
 The following works fine, for example
 > r.mapcalc newmap = 5
 > Note the lack of quotes and the spaces on either side of the "=".

 r.mapcalc is a poor example, for the reason given above.

 > I think the command processor also allows strings with spaces surrounded
 by quotes within arguments if a command requires them,

 The original report suggests otherwise. That is the real problem here. The
 fact that the 6.x r.mapcalc provides a workaround doesn't help in general.

 > but I would need to test this on a particular set of cases. I currently
 can't think of an appropriate test, but I'm sure there are such cases.

 Choose any command which accepts a filename argument, and pass a filename
 which contains spaces.

Ticket URL: <http://trac.osgeo.org/grass/ticket/528#comment:11>
GRASS GIS <http://grass.osgeo.org>

More information about the grass-dev mailing list