-
-
Couldn't load subscription status.
- Fork 640
os.findheader support relative headerdirs
#2469
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -159,7 +159,16 @@ | |
| elseif type(headerdirs) == "table" then | ||
| userpaths = headerdirs | ||
| end | ||
| paths = table.join(userpaths, paths) | ||
|
|
||
| for _, userpath in ipairs(userpaths) do | ||
| if path.isabsolute(userpath) then | ||
| paths = table.join({userpath}, paths) | ||
| else | ||
| for _, p in ipairs(paths) do | ||
| paths = table.join({path.join(p, userpath)}, paths) | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same here There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think the search should prioritize subdirectories. For example, if a user's computer has both There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. In addition you iterate and modify A |
||
| end | ||
| end | ||
| end | ||
|
|
||
| local result = os.pathsearch (headerpath, table.unpack(paths)) | ||
| return result | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| // Only used for presence in tests |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think "append" should be use instead of "prepend", to keep original order