[GRASS-dev] G_legal_filename and "/"

Glynn Clements glynn at gclements.plus.com
Sat Feb 3 22:17:02 EST 2007


J-Báchym Čepický wrote:-A

> > > IMHO "/" character is legal character in file name. I suggest change
> > > line 43 in lib/gis/legal_filename.c:
> > >
> > >
> > > -     if (*s == '/' || *s == '"' || *s == '\'' || *s <= ' ' ||
> > >
> > > +     if (*s == '"' || *s == '\'' || *s <= ' ' ||
> > >
> > > What do you think?
> >
> > No, "/" most definitely isn't a legal character in a filename, as it's
> > used as a directory separator on all supported platforms. It's legal
> > in a *pathname*, but that isn't what G_legal_filename() is meant for.
> 
> While using g.pnmcomp with output file specified by full path (e.g.
> "/tmp/out.png"), I get the warning about Illegal character in file
> name.

That's because I added bogus "gisprompt" definitions to the output=
and outmask= options, so the parser thinks that these options are
supposed to be map names. Fixed in CVS.

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




More information about the grass-dev mailing list