Skip to content
Permalink
Browse files
Fix -- in quoted names
  • Loading branch information
elpaso authored and nyalldawson committed Nov 5, 2021
1 parent 30078df commit d509836d164b2d13f727086301db198772f37d9a
Showing with 3 additions and 1 deletion.
  1. +3 −1 src/core/providers/ogr/qgsogrproviderutils.cpp
@@ -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( "--" ) ) )
{

0 comments on commit d509836

Please sign in to comment.