[GRASS-dev] [GRASS GIS] #32: r.what: shouldn't use static buffers for the inputs

Glynn Clements glynn at gclements.plus.com
Mon Feb 25 01:18:33 EST 2008


Ivan Shmakov wrote:

>  >> I did it as %c like r.cats, other modules are more liberal and allow
>  >> %s.  Shrug.
> 
>  > I have no use for %s just now, but there should probably be a
>  > GRASS-wide policy on using either %c or %s for `fs'.  (In order for
>  > the user to learn this exactly once.)
> 
> 	Since the function above allows strings, I'd opt for allowing a
> 	string for `sep' everywhere.

When a string is used as a separator, the behaviour isn't entirely
obvious. If the string is passed as the separator argument to
G_tokenize(), it treats the string as a set of characters, all of
which are treated as separators.

For a module to provide this behaviour, it would be more natural to
use e.g. "opt.sep->multiple = YES" and require the individual values
to be single characters (after any parsing of backslash sequences).

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


More information about the grass-dev mailing list