Skip to content
This repository has been archived by the owner on Aug 7, 2023. It is now read-only.

Expanding a directory recursively under Windows OS doesn't work #167

Open
giuseppedandrea opened this issue Mar 19, 2018 · 0 comments
Open

Comments

@giuseppedandrea
Copy link

Issue

Under Windows OS there's an issue in GCC Include Paths setting when using ./* or -/* to expand a directory recursively starting from the project root or from the path of the active file (option added with commit c775c98).
Looking at the splitStringTrim function (code below), when using the include path ./* (the same using the include path -/*) and expandPaths is true, the program execute the pathm.join method (line 101 and 105 respectively) and return a path like <Path of the project root or Path of the active file>\* because under Windows OS path separator is \.
So /* is changed to \* and this is the issue because the statement at line 107 (item.substring(item.length-2, item.length) == '/*' && expandPaths) will never be true and recursion is not performed.
https://github.com/hebaishi/linter-gcc/blob/14f48124f49c60b2d19268e0506712e21b325982/lib/utility.js#L86-L122

Possible solution

One possible solution is the following in which row 107 is modified.
From:
if (item.substring(item.length-2, item.length) == '/*' && expandPaths) {
to:
if ((item.substring(item.length-2, item.length) == '/*' || item.substring(item.length-2, item.length) == '\\*') && expandPaths) {

@giuseppedandrea giuseppedandrea changed the title Expand a directory recursively under Windows OS Expanding a directory recursively under Windows OS doesn't work Mar 19, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant