[GRASS-dev] Re: lib/vector/Vlib/*.c: Too much uses of GRASS_VECT_DIRECTORY

Markus Metz markus.metz.giswork at googlemail.com
Sun Mar 22 10:21:20 EDT 2009

Ivan Shmakov wrote:
>  >> Basically, this one introduces three tiny new functions to be used
>  >> instead of coding the construction of the vector map-related
>  >> filenames explicitly.  Like:
>  >> -   sprintf (buf, "%s/%s", GRASS_VECT_DIRECTORY, map_info->name);
>  >> +   Vect_map_file_name_rel (buf, map_info);
>  > If it's tested, at least I have no objections.
> 	Any ideas on how to perform the testing?  I'm going to try to
> 	perform some operations on the vectors in my data sets, but I
> 	just can't think out anything better than that (to do in a
> 	reasonable time.)
No better ideas here, but maybe some other developers have some ideas 
(apart from using very long vector names).
>  > Not sure if it will give problems when char buf[200] is treated as
>  > char result[GPATH_MAX].
> 	That's the problem of the already existing code, which is going
> 	to show up when someone will try to work with vector names
> 	longer than 192 characters.  Obviously, 200 should be replaced
> 	with GPATH_MAX.  That should be a separate patch.
Interesting. Maybe fix that first because it is a potential bug, i.e. 
use GNAME_MAX, GMAPSET_MAX, and GPATH_MAX wherever appropriate? As I 
understand, your patch is an improvement but not a bugfix, so I would 
opt for fixing (potential) bugs first, then improve. Maybe wait for a 
second opinion, I'm still new here.

>  > Second, I have already changed G_find_file2 to G_find_vector2 in
>  > Vect_open_new.
> 	ACK.  Thanks.
I think it's better if I don't touch these parts anymore as long as you 
are busy with it, just to avoid confusion, and leave vector name 
handling to you.

Best regards,

Markus M

More information about the grass-dev mailing list