Opened 21 years ago
Last modified 21 years ago
#310 closed defect (fixed)
Shape file name incorrectly generated
Reported by: | Owned by: | warmerdam | |
---|---|---|---|
Priority: | high | Milestone: | |
Component: | OGR_SF | Version: | unspecified |
Severity: | normal | Keywords: | |
Cc: |
Description
In file ogrshapedatasource.cpp, method CreateLayer(), in conditional statement: if( bSingleNewFile && nLayers == 0 ) { char *pszPath = CPLStrdup(CPLGetPath(pszName)); pszBasename = CPLStrdup(CPLFormFilename(pszPath, CPLGetBasename(pszName), NULL)); CPLFree( pszPath ); } CPLGetBasename() returns an address to a static variable in file cpl_port.cpp. This address is then passed as a string to CPLFormFilename(), which prints the string to the same static variable. Results in the file name being incorrectly generated. Need to make a deep copy of the string returned from CPLGetBasename and pass this deep copy as the argument to CPLFormFilename() instead.
Note:
See TracTickets
for help on using tickets.