@@ -476,7 +476,7 @@ string getConfigurationLocation()
476
476
477
477
// / Patch the INI file to v0.5.0 format.
478
478
// TODO: remove this from v0.6.0
479
- bool hasWrongIniFileSection (string confiFilename , bool patch)
479
+ bool hasWrongIniFileSection (string configFilename , bool patch)
480
480
{
481
481
import std.string : indexOf;
482
482
import std.array : replace;
@@ -486,21 +486,21 @@ bool hasWrongIniFileSection(string confiFilename, bool patch)
486
486
static immutable v1 = " analysis.config.StaticAnalysisConfig" ;
487
487
static immutable v2 = " dscanner.analysis.config.StaticAnalysisConfig" ;
488
488
489
- char [] c = cast (char []) readFile(confiFilename );
490
- try if (const ptrdiff_t i = c.indexOf(v1) )
489
+ char [] c = cast (char []) readFile(configFilename );
490
+ try if (c.indexOf(v2) < 0 )
491
491
{
492
492
if (! patch)
493
493
{
494
- writeln(" warning, the configuration file `" , confiFilename , " ` contains an outdated property" );
494
+ writeln(" warning, the configuration file `" , configFilename , " ` contains an outdated property" );
495
495
writeln(" change manually [" , v1, " ] to [" , v2, " ]" );
496
496
writeln(" or restart D-Scanner with the `--patchConfig` option" );
497
497
result = true ;
498
498
}
499
499
else
500
500
{
501
501
c = replace(c, v1, v2);
502
- std.file.write (confiFilename , c);
503
- writeln(" the configuration file `" , confiFilename , " ` has been updated correctly" );
502
+ std.file.write (configFilename , c);
503
+ writeln(" the configuration file `" , configFilename , " ` has been updated correctly" );
504
504
}
505
505
}
506
506
catch (Exception e)
0 commit comments