Skip to content
This repository was archived by the owner on Aug 9, 2025. It is now read-only.

Commit ce8fb04

Browse files
committed
Infinite loop when browsing for cppcheck.exe removed (fixed #182)
1 parent f48c2af commit ce8fb04

File tree

1 file changed

+9
-13
lines changed

1 file changed

+9
-13
lines changed

CPPCheckPlugin/AnalyzerCppcheck.cs

Lines changed: 9 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -59,20 +59,16 @@ public static string cppcheckExePath()
5959

6060
if (String.IsNullOrEmpty(analyzerPath))
6161
{
62-
for (; ; )
63-
{
64-
OpenFileDialog dialog = new OpenFileDialog();
65-
dialog.Filter = "cppcheck executable|cppcheck.exe";
66-
if (dialog.ShowDialog() != DialogResult.OK)
67-
continue;
62+
OpenFileDialog dialog = new OpenFileDialog();
63+
dialog.Filter = "cppcheck executable|cppcheck.exe";
64+
if (dialog.ShowDialog() != DialogResult.OK)
65+
return String.Empty;
6866

69-
analyzerPath = dialog.FileName;
70-
if (File.Exists(analyzerPath))
71-
{
72-
Properties.Settings.Default.CPPcheckPath.Add(analyzerPath);
73-
Properties.Settings.Default.Save();
74-
break;
75-
}
67+
analyzerPath = dialog.FileName;
68+
if (File.Exists(analyzerPath))
69+
{
70+
Properties.Settings.Default.CPPcheckPath.Add(analyzerPath);
71+
Properties.Settings.Default.Save();
7672
}
7773
}
7874

0 commit comments

Comments
 (0)