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

Search: careful with path.basename() #38770

Closed
bpasero opened this issue Nov 20, 2017 · 0 comments
Closed

Search: careful with path.basename() #38770

bpasero opened this issue Nov 20, 2017 · 0 comments
Assignees
Labels
debt Code quality issues search Search widget and operation issues

Comments

@bpasero
Copy link
Member

bpasero commented Nov 20, 2017

Careful when using path.basename, it can return an empty string depending on usage and depending on which basename method is used (there is a node.js one and a one in common from us).

node.js

  • windows drive letter: empty string
  • unix root: empty string

common

  • windows drive letter: keeps the drive letter
  • unix root: empty string

I am seeing some suspicious usages here and here.

Maybe do a general check for path.basename where a folder path is passed in as argument. This is not an issue for file paths obviously.

@bpasero bpasero added debt Code quality issues search Search widget and operation issues labels Nov 20, 2017
@bpasero bpasero changed the title Search: careful with path.basename() on windows drive letters Search: careful with path.basename() Nov 20, 2017
@roblourens roblourens added this to the September 2018 milestone Sep 17, 2018
@vscodebot vscodebot bot locked and limited conversation to collaborators Nov 1, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
debt Code quality issues search Search widget and operation issues
Projects
None yet
Development

No branches or pull requests

2 participants