diffs for .shp

ender at titan.lab.csuchico.edu ender at titan.lab.csuchico.edu
Thu Aug 10 04:26:57 EDT 2000


I made a little change to mapshape.c that allows you to use:

DATA whatever/shapefile.shp

in the mapfile, instead of these shapes just being ignored.  I find that I
still do this, even though I've been using mapserver for several years
now.

Anyway, here's the diff file.

-Aaron


1166c1166,1167
<   char *dbfFilename;
---
>   int i;
>   char * dbfFilename;
1195,1197c1196,1209
<   
<   dbfFilename = (char *)malloc(strlen(filename)+5);
<   sprintf(dbfFilename, "%s.dbf", filename);
---
> 
>   dbfFilename = (char*)malloc(strlen(filename)+5);
>   strcpy(dbfFilename, filename);
> 
>   /* clean off any extention the filename might have */
>   for (i = strlen(dbfFilename) - 1;
>        i > 0 && dbfFilename[i] != '.' && dbfFilename[i] != '/'
>          && dbfFilename[i] != '\\';
>        i-- ) {}
> 
>   if( dbfFilename[i] == '.' )
>     dbfFilename[i] = '\0';
> 
>   strcat(dbfFilename, ".dbf");
-------------- next part --------------
1166c1166,1167
<   char *dbfFilename;
---
>   int i;
>   char * dbfFilename;
1195,1197c1196,1209
<   
<   dbfFilename = (char *)malloc(strlen(filename)+5);
<   sprintf(dbfFilename, "%s.dbf", filename);
---
> 
>   dbfFilename = (char*)malloc(strlen(filename)+5);
>   strcpy(dbfFilename, filename);
> 
>   /* clean off any extention the filename might have */
>   for (i = strlen(dbfFilename) - 1;
>        i > 0 && dbfFilename[i] != '.' && dbfFilename[i] != '/'
>          && dbfFilename[i] != '\\';
>        i-- ) {}
> 
>   if( dbfFilename[i] == '.' )
>     dbfFilename[i] = '\0';
> 
>   strcat(dbfFilename, ".dbf");


More information about the mapserver-users mailing list