Skip to content

Commit

Permalink
Fix -- in quoted names
Browse files Browse the repository at this point in the history
  • Loading branch information
elpaso authored and nyalldawson committed Nov 5, 2021
1 parent 30078df commit d509836
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/core/providers/ogr/qgsogrproviderutils.cpp
Expand Up @@ -1309,11 +1309,13 @@ OGRLayerH QgsOgrProviderUtils::setSubsetString( OGRLayerH layer, GDALDatasetH ds
for ( auto &line : lines )
{
bool inLiteral {false};
QChar literalChar { ' ' };
for ( int i = 0; i < line.length(); ++i )
{
if ( line[i] == QChar( '\'' ) && ( i == 0 || line[i - 1] != QChar( '\\' ) ) )
if ( ( ( line[i] == QChar( '\'' ) || line[i] == QChar( '"' ) ) && ( i == 0 || line[i - 1] != QChar( '\\' ) ) ) && ( line[i] != literalChar ) )
{
inLiteral = !inLiteral;
literalChar = inLiteral ? line[i] : QChar( ' ' );
}
if ( !inLiteral && line.mid( i ).startsWith( QStringLiteral( "--" ) ) )
{
Expand Down

0 comments on commit d509836

Please sign in to comment.