Skip to content

Unable to get absolute uri between ex.txt and z:; Base path 'z:' must be an absolute path #1928

@rasa

Description

@rasa

In Windows, if I edit the file ex.txt in the root of a mapped network drive, say Z:\, I get this error:

Unable to get absolute uri between ex.txt and z:; Base path 'z:' must be an absolute path

This is because this code:

if (path.charCodeAt(path.length - 1) === slash) {
path = path.slice(0, -1);
}

is removing the trashing slash. This works for all paths except for paths in the root folder, where the trailing slash should remain. This could be fixed via:

if (path.charCodeAt(path.length - 1) === slash) { 
  // Don't remove the trailing slash on Windows root folders, such as z:\
  if (path.length != 3 || (path.length == 3 && path.charCodeAt(1)  != ':')) {
    path = path.slice(0, -1); 
  }
} 

Metadata

Metadata

Assignees

Labels

Type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions