Skip to content

Commit 14ae261

Browse files
wilzbachbbasile
authored andcommitted
Hot-fix for #570 (#572)
1 parent eb28103 commit 14ae261

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

src/dscanner/main.d

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -476,7 +476,7 @@ string getConfigurationLocation()
476476

477477
/// Patch the INI file to v0.5.0 format.
478478
//TODO: remove this from v0.6.0
479-
bool hasWrongIniFileSection(string confiFilename, bool patch)
479+
bool hasWrongIniFileSection(string configFilename, bool patch)
480480
{
481481
import std.string : indexOf;
482482
import std.array : replace;
@@ -486,21 +486,21 @@ bool hasWrongIniFileSection(string confiFilename, bool patch)
486486
static immutable v1 = "analysis.config.StaticAnalysisConfig";
487487
static immutable v2 = "dscanner.analysis.config.StaticAnalysisConfig";
488488

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)
491491
{
492492
if (!patch)
493493
{
494-
writeln("warning, the configuration file `", confiFilename, "` contains an outdated property");
494+
writeln("warning, the configuration file `", configFilename, "` contains an outdated property");
495495
writeln("change manually [", v1, "] to [", v2, "]" );
496496
writeln("or restart D-Scanner with the `--patchConfig` option");
497497
result = true;
498498
}
499499
else
500500
{
501501
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");
504504
}
505505
}
506506
catch(Exception e)

0 commit comments

Comments
 (0)