From 98aad22f6750dc55d7f39231b41f23da255f8134 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20=27Danol=27=20=C4=8Cejchan?= Date: Tue, 17 Jan 2017 12:57:05 +0100 Subject: [PATCH] Fix -c flag not looking into the top level folder --- src/dfmt/editorconfig.d | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/dfmt/editorconfig.d b/src/dfmt/editorconfig.d index b25b9ef..205b9a4 100644 --- a/src/dfmt/editorconfig.d +++ b/src/dfmt/editorconfig.d @@ -132,9 +132,9 @@ EC getConfigFor(EC)(string path) EC[][] configs; immutable expanded = absolutePath(path); immutable bool id = isDir(expanded); - immutable string dir = dirName(expanded); immutable string fileName = id ? "dummy.d" : baseName(expanded); - string[] pathParts = cast(string[]) pathSplitter(dir).array(); + string[] pathParts = cast(string[]) pathSplitter(expanded).array(); + for (size_t i = pathParts.length; i > 1; i--) { EC[] sections = parseConfig!EC(buildPath(pathParts[0 .. i]));