From c3bb7caeb03ee1071399b3035fe984efcfe59875 Mon Sep 17 00:00:00 2001 From: Jeff Lounsbury Date: Mon, 15 Apr 2002 22:38:37 +0000 Subject: [PATCH] fixed bug that allowed two field names to be the same in shp2psql, we are now checking for that. git-svn-id: http://svn.osgeo.org/postgis/trunk@134 b70326c6-7e19-0410-871a-916f4a2858ee --- loader/shp2pgsql.c | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) diff --git a/loader/shp2pgsql.c b/loader/shp2pgsql.c index 280e7a5d5..dfa1327e3 100644 --- a/loader/shp2pgsql.c +++ b/loader/shp2pgsql.c @@ -421,11 +421,12 @@ int main (int ARGC, char **ARGV){ int num_fields,num_records,begin,trans; int num_entities, phnshapetype,next_ring,errflg,c; double padminbound[8], padmaxbound[8]; - int u,j,tot_rings,curindex; + int u,j,z,tot_rings,curindex; SHPObject *obj=NULL; - char name[12]; + char name[32]; char opt; char *sr_id,*shp_file,*table, *database; + char **names; DBFFieldType type; extern char *optarg; extern int optind; @@ -539,10 +540,20 @@ int main (int ARGC, char **ARGV){ num_fields = DBFGetFieldCount( hDBFHandle ); num_records = DBFGetRecordCount(hDBFHandle); - + names = malloc(num_fields +1); for(j=0;j