Changeset 7566

Show
Ignore:
Timestamp:
05/07/08 00:13:29 (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
  • branches/branch-5-0/mapserver/HISTORY.TXT

    r7564 r7566  
    1313Current Version (future 5.0.3, svn branch-5-0) 
    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) 
  • branches/branch-5-0/mapserver/mapshape.c

    r7261 r7566  
    14341434  rectObj shaperect; 
    14351435  char *filename; 
     1436  char *sourcename = 0; /* shape file source string from map file */ 
     1437  char *s = 0; /* pointer to start of '.shp' in source string */ 
     1438 
    14361439 
    14371440  if(shpfile->status) { 
     
    14551458      msSetBit(shpfile->status, i, 1); 
    14561459  } else { 
    1457     if((filename = (char *)malloc(strlen(shpfile->source)+strlen(MS_INDEX_EXTENSION)+1)) == NULL) { 
     1460 
     1461    /* deal with case where sourcename is of the form 'file.shp' */ 
     1462    sourcename = strdup(shpfile->source); 
     1463    s = strcasestr(sourcename, ".shp"); 
     1464    if( s ) *s = '\0'; 
     1465 
     1466    if((filename = (char *)malloc(strlen(sourcename)+strlen(MS_INDEX_EXTENSION)+1)) == NULL) { 
    14581467      msSetError(MS_MEMERR, NULL, "msSHPWhichShapes()");     
    14591468      return(MS_FAILURE); 
    14601469    } 
    1461     sprintf(filename, "%s%s", shpfile->source, MS_INDEX_EXTENSION); 
     1470    sprintf(filename, "%s%s", sourcename, MS_INDEX_EXTENSION); 
    14621471     
    14631472    shpfile->status = msSearchDiskTree(filename, rect, debug); 
    14641473    free(filename); 
     1474    free(sourcename); 
    14651475 
    14661476    if(shpfile->status) /* index  */