[GRASS-dev] G_legal_filename and "/"

Hi,
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?

Jachym
--
Jachym Cepicky
e-mail: jachym.cepicky gmail com
URL: http://les-ejk.cz
GPG: http://www.les-ejk.cz/pgp/jachym_cepicky-gpg.pub

Je-Báchym Èepický wrote:e-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.

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

hi Glynn,

2007/2/3, Glynn Clements <glynn@gclements.plus.com>:

Je-Báchym Èepický wrote:e-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.

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

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.

How to avoid this problem?

Thanks

Jachym
--
Jachym Cepicky
e-mail: jachym.cepicky gmail com
URL: http://les-ejk.cz
GPG: http://www.les-ejk.cz/pgp/jachym_cepicky-gpg.pub

Je-Báchym Èepický wrote:e-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@gclements.plus.com>