Changeset 7565

Show
Ignore:
Timestamp:
05/07/08 00:08:16 (2 months ago)
Author:
pramsey
Message:

Don't ignore .qix file when DATA reference includes .shp extension (#590)

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/mapserver/HISTORY.TXT

    r7563 r7565  
    1313Current Version (5.1-dev, SVN trunk): 
    1414------------------------------------- 
     15 
     16- Don't ignore .qix file when DATA reference includes .shp extension (#590) 
    1517 
    1618- CGI able to alter layers with space and underscores (#2516) 
  • trunk/mapserver/mapshape.c

    r7535 r7565  
    17191719  rectObj shaperect; 
    17201720  char *filename; 
    1721  
     1721  char *sourcename = 0; /* shape file source string from map file */ 
     1722  char *s = 0; /* pointer to start of '.shp' in source string */ 
     1723   
    17221724  if(shpfile->status) { 
    17231725    free(shpfile->status); 
     
    17371739      return(MS_FAILURE); 
    17381740    } 
    1739     for(i=0;i<shpfile->numshapes;i++)  
     1741    for(i=0;i<shpfile->numshapes;i++) { 
    17401742      msSetBit(shpfile->status, i, 1); 
    1741   } else { 
    1742     if((filename = (char *)malloc(strlen(shpfile->source)+strlen(MS_INDEX_EXTENSION)+1)) == NULL) { 
     1743    } 
     1744  }  
     1745  else { 
     1746 
     1747    /* deal with case where sourcename is of the form 'file.shp' */ 
     1748    sourcename = strdup(shpfile->source); 
     1749    s = strcasestr(sourcename, ".shp"); 
     1750    if( s ) *s = '\0'; 
     1751 
     1752    if((filename = (char *)malloc(strlen(sourcename)+strlen(MS_INDEX_EXTENSION)+1)) == NULL) { 
    17431753      msSetError(MS_MEMERR, NULL, "msShapefileWhichShapes()");     
    17441754      return(MS_FAILURE); 
    17451755    } 
    1746     sprintf(filename, "%s%s", shpfile->source, MS_INDEX_EXTENSION); 
     1756   
     1757    sprintf(filename, "%s%s", sourcename, MS_INDEX_EXTENSION); 
    17471758     
    17481759    shpfile->status = msSearchDiskTree(filename, rect, debug); 
    17491760    free(filename); 
     1761    free(sourcename); 
    17501762 
    17511763    if(shpfile->status) { /* index  */