|
@@ -113,8 +113,8 @@ off_t V1_rewrite_line_nat(struct Map_info *Map, int line, int type, off_t offset
|
|
|
const struct line_pnts *points, const struct line_cats *cats)
|
|
|
{
|
|
|
int old_type;
|
|
|
- struct line_pnts *old_points;
|
|
|
- struct line_cats *old_cats;
|
|
|
+ static struct line_pnts *old_points = NULL;
|
|
|
+ static struct line_cats *old_cats = NULL;
|
|
|
off_t new_offset;
|
|
|
|
|
|
G_debug(3, "V1_rewrite_line_nat(): line = %d offset = %lu",
|
|
@@ -123,8 +123,10 @@ off_t V1_rewrite_line_nat(struct Map_info *Map, int line, int type, off_t offset
|
|
|
/* TODO: enable points and cats == NULL */
|
|
|
|
|
|
/* First compare numbers of points and cats with tha old one */
|
|
|
- old_points = Vect_new_line_struct();
|
|
|
- old_cats = Vect_new_cats_struct();
|
|
|
+ if (!old_points) {
|
|
|
+ old_points = Vect_new_line_struct();
|
|
|
+ old_cats = Vect_new_cats_struct();
|
|
|
+ }
|
|
|
|
|
|
old_type = V1_read_line_nat(Map, old_points, old_cats, offset);
|
|
|
if (old_type == -1)
|