Opened 17 years ago
Closed 17 years ago
#1609 closed enhancement (fixed)
OGRVRTDriver::Open() fails to detect <OGRVRTDataSource>
Reported by: | Daniel Morissette | Owned by: | Daniel Morissette |
---|---|---|---|
Priority: | normal | Milestone: | |
Component: | OGR_SF | Version: | unspecified |
Severity: | normal | Keywords: | VRT |
Cc: | warmerdam |
Description
OGRVRTDriver::Open() uses the following code to detect whether it is being passed an XML definition directly:
if( EQUALN(pszFilename,"<OGRVRTDataSource>",18) ) {
pszXML = CPLStrdup(pszFilename);
}
This is fine in most cases, but if there are leading spaces and/or linebreaks then it fails to detect the opening tag and fails to open the file. This often happens to users of MapServer who embed an XML VRT definition in a CONNECTION string and start it on a new line (I've seen that done twice so far).
What would you think of modifying the test above to skip any leading spaces or newlines using isspace()?
Change History (2)
comment:1 by , 17 years ago
Cc: | added |
---|---|
Component: | default → OGR_SF |
Keywords: | VRT added |
Owner: | changed from | to
comment:2 by , 17 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
Fixed.
Implemented skipping of spaces in r11546.
Daniel,
Feel free to apply such a change. It sounds quick harmless.