[GRASS-dev] Re: [GRASS-CVS] brad: grass6/lib/gis legal_name.c, 2.6, 2.7

Brad,

Despite of this fix I can still create vectors with @ in names. eg:

$ v.random out=map@rubbish n=10

works.

What's wrong?

grass@intevation.de wrote:

Author: brad

Update of /grassrepository/grass6/lib/gis
In directory doto:/tmp/cvs-serv30860

Modified Files:
  legal_name.c
Log Message:
- Added '@' to illegal file name characters.

Index: legal_name.c

RCS file: /grassrepository/grass6/lib/gis/legal_name.c,v
retrieving revision 2.6
retrieving revision 2.7
diff -u -d -r2.6 -r2.7
--- legal_name.c 7 Sep 2006 12:04:13 -0000 2.6
+++ legal_name.c 4 Oct 2006 19:58:03 -0000 2.7
@@ -19,7 +19,7 @@
  *
  * Legal file names will <b>not</b> begin with '.' or NULL and must
  * not contain the characters, ' ' (space), '/', '"'. '\'' (single
- * quote), and all other non-alphanumeric characters within.
+ * quote), '@', and all other non-alphanumeric characters within.
  *
  * Returns 1 if <b>name</b> is ok, -1 otherwise.
  *
@@ -35,8 +35,8 @@
     }

     for ( ; *s; s++)
- if (*s == '/' || *s == '"' || *s == '\'' || *s <= ' ' || *s > 0176) {
- fprintf(stderr, _("Illegal filename. character <%c> not allowed."), *s);
+ if (*s == '/' || *s == '"' || *s == '\'' || *s <= ' ' || *s == '@' || *s > 0176) {
+ fprintf(stderr, _("Illegal filename. character <%c> not allowed.\n"), *s);
       return -1;
   }

The module doesn't call G_legal_filename(), so it doesn't get checked.
Also note that G_legal_filename() is not location/mapset aware.

On Thu, 2006-10-19 at 20:00 +0200, Maciej Sieczka wrote:

Brad,

Despite of this fix I can still create vectors with @ in names. eg:

$ v.random out=map@rubbish n=10

works.

What's wrong?

grass@intevation.de wrote:
> Author: brad
>
> Update of /grassrepository/grass6/lib/gis
> In directory doto:/tmp/cvs-serv30860
>
> Modified Files:
> legal_name.c
> Log Message:
> - Added '@' to illegal file name characters.
>
>
>
> Index: legal_name.c
> ===================================================================
> RCS file: /grassrepository/grass6/lib/gis/legal_name.c,v
> retrieving revision 2.6
> retrieving revision 2.7
> diff -u -d -r2.6 -r2.7
> --- legal_name.c 7 Sep 2006 12:04:13 -0000 2.6
> +++ legal_name.c 4 Oct 2006 19:58:03 -0000 2.7
> @@ -19,7 +19,7 @@
> *
> * Legal file names will <b>not</b> begin with '.' or NULL and must
> * not contain the characters, ' ' (space), '/', '"'. '\'' (single
> - * quote), and all other non-alphanumeric characters within.
> + * quote), '@', and all other non-alphanumeric characters within.
> *
> * Returns 1 if <b>name</b> is ok, -1 otherwise.
> *
> @@ -35,8 +35,8 @@
> }
>
> for ( ; *s; s++)
> - if (*s == '/' || *s == '"' || *s == '\'' || *s <= ' ' || *s > 0176) {
> - fprintf(stderr, _("Illegal filename. character <%c> not allowed."), *s);
> + if (*s == '/' || *s == '"' || *s == '\'' || *s <= ' ' || *s == '@' || *s > 0176) {
> + fprintf(stderr, _("Illegal filename. character <%c> not allowed.\n"), *s);
> return -1;
> }

--
Brad Douglas <rez touchofmadness com> KB8UYR/6
Address: 37.493,-121.924 / WGS84 National Map Corps #TNMC-3785