From 11db9b35eff6853743ee8e3222999d7e3ab8bb65 Mon Sep 17 00:00:00 2001 From: "seer-by-sentry[bot]" <157164994+seer-by-sentry[bot]@users.noreply.github.com> Date: Mon, 11 Aug 2025 03:34:40 +0000 Subject: [PATCH 1/2] Fix: Fixed issue with WindowsIniService not handling duplicate section names --- .../Services/Windows/WindowsIniService.cs | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/src/Files.App/Services/Windows/WindowsIniService.cs b/src/Files.App/Services/Windows/WindowsIniService.cs index 5151918fa13e..eabf759d7db9 100644 --- a/src/Files.App/Services/Windows/WindowsIniService.cs +++ b/src/Files.App/Services/Windows/WindowsIniService.cs @@ -25,14 +25,13 @@ public List GetData(string filePath) return []; } - // Get sections - var sections = lines - .Where(line => line.StartsWith('[') && line.EndsWith(']')); - - // Get section line indexes + // Get section line indexes directly to handle duplicate section names List sectionLineIndexes = []; - foreach (var section in sections) - sectionLineIndexes.Add(lines.IndexOf(section)); + for (int i = 0; i < lines.Count; i++) + { + if (lines[i].StartsWith('[') && lines[i].EndsWith(']')) + sectionLineIndexes.Add(i); + } List dataItems = []; @@ -42,10 +41,10 @@ public List GetData(string filePath) var count = index + 1 == sectionLineIndexes.Count - ? (lines.Count - 1) - sectionIndex - : sectionLineIndexes[index + 1] - sectionIndex; + ? lines.Count - sectionIndex - 1 + : sectionLineIndexes[index + 1] - sectionIndex - 1; - if (count == 0) + if (count <= 0) continue; var range = lines.GetRange(sectionIndex + 1, count); From 3830f5cf4c27bec6e078fd869f346ac453764c3b Mon Sep 17 00:00:00 2001 From: Yair <39923744+yaira2@users.noreply.github.com> Date: Mon, 11 Aug 2025 19:00:31 -0400 Subject: [PATCH 2/2] Update ModernShellPage.xaml --- src/Files.App/Views/Shells/ModernShellPage.xaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Files.App/Views/Shells/ModernShellPage.xaml b/src/Files.App/Views/Shells/ModernShellPage.xaml index afbb5ad7b82c..98b5392ee316 100644 --- a/src/Files.App/Views/Shells/ModernShellPage.xaml +++ b/src/Files.App/Views/Shells/ModernShellPage.xaml @@ -49,7 +49,7 @@