Skip to content
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

[ospaths] toSeq(parentDirs("/a/b")) returns @["/a/b", "/a", ""] instead of @["/a/b", "/a", "/"] (last entry wrong) #8353

Closed
timotheecour opened this issue Jul 18, 2018 · 6 comments · Fixed by #13236
Assignees
Labels
OS (stdlib) Related to OS modules in standard library Standard Library

Comments

@timotheecour
Copy link
Member

No description provided.

@Bennyelg
Copy link
Contributor

Works fine when I compile it

import ospaths
import sequtils
for e in parentDirs("/Users/benny/Work"):
    echo(e)


echo(toSeq(parentDirs("/Users/benny/Work")))

@Bennyelg
Copy link
Contributor

Bennyelg commented Jul 18, 2018

Same with

toSeq(parentDirs("/a/b"))

outputs:
@["/a/b", "/a", ""]

@timotheecour
Copy link
Member Author

yes, that's the problem, it should be @["/a/b", "/a", "/"], not @["/a/b", "/a", ""]
the last entry "" is bad

@Bennyelg
Copy link
Contributor

Yea, I was misleading by the issue name.

@timotheecour
Copy link
Member Author

related to that: #8395 ospaths: tailDir("/usr/local/bin") should be "usr/local/bin" instead of "local/bin" (because of /) #8395

@timotheecour timotheecour added the OS (stdlib) Related to OS modules in standard library label Oct 25, 2018
@timotheecour timotheecour self-assigned this Feb 4, 2019
timotheecour added a commit to timotheecour/Nim that referenced this issue Feb 4, 2019
timotheecour added a commit to timotheecour/Nim that referenced this issue Feb 4, 2019
timotheecour added a commit to timotheecour/Nim that referenced this issue Feb 4, 2019
timotheecour added a commit to timotheecour/Nim that referenced this issue Feb 11, 2019
@timotheecour
Copy link
Member Author

related to that: #8395 ospaths: tailDir("/usr/local/bin") should be "usr/local/bin" instead of "local/bin" (because of /) #8395

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment