From b1cec6ab3c8e731bd1b5e4f979ea446ecf4ba59b Mon Sep 17 00:00:00 2001 From: huangqinjin Date: Wed, 9 Apr 2025 00:18:04 +0800 Subject: [PATCH] Allow reading config files at filesystem/drive root --- src/EditorConfig.Core/EditorConfigParser.cs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/EditorConfig.Core/EditorConfigParser.cs b/src/EditorConfig.Core/EditorConfigParser.cs index ff137fc..bed1ffc 100644 --- a/src/EditorConfig.Core/EditorConfigParser.cs +++ b/src/EditorConfig.Core/EditorConfigParser.cs @@ -134,7 +134,6 @@ where File.Exists(configFile) private IEnumerable AllParentDirectories(string fullPath) { - var root = new DirectoryInfo(fullPath).Root.FullName; var dir = Path.GetDirectoryName(fullPath); do { @@ -143,7 +142,7 @@ private IEnumerable AllParentDirectories(string fullPath) var dirInfo = new DirectoryInfo(dir); if (dirInfo.Parent == null) yield break; dir = dirInfo.Parent.FullName; - } while (dir != root); + } while (true); } } }