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

Ivan Shmakov oneingray at gmail.com
Sun Mar 22 09:51:36 EDT 2009

>>>>> Markus Metz <markus.metz.giswork at googlemail.com> writes:

 >> May I suggest the change below?

 >> 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.)

 > 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.

	One reason behind these functions was to enable the compiler to
	recognize the errors like that and possibly emit a warning.

 > Just two remarks.  First, please work with latest svn version which
 > is r36445 since 2009-03-21 10:19:54 +0100 i.e. yesterday, because I'm
 > also busy with the vector libs.


 > Second, I have already changed G_find_file2 to G_find_vector2 in
 > Vect_open_new.

	ACK.  Thanks.


FSF associate member #7257

More information about the grass-dev mailing list