Skip to content

Commit 264ed5e

Browse files
authored
trim the path before checking if it exists (#1924)
1 parent ded26d6 commit 264ed5e

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

Extension/src/LanguageServer/configurations.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -238,8 +238,9 @@ export class CppProperties {
238238
// Check for vcpkg instance and include relevent paths if found.
239239
if (await util.checkFileExists(util.getVcpkgPathDescriptorFile())) {
240240
let vcpkgRoot: string = await util.readFileText(util.getVcpkgPathDescriptorFile());
241+
vcpkgRoot = vcpkgRoot.trim();
241242
if (await util.checkDirectoryExists(vcpkgRoot)) {
242-
let vcpkgInstalledPath: string = path.join(vcpkgRoot.trim(), "/installed");
243+
let vcpkgInstalledPath: string = path.join(vcpkgRoot, "/installed");
243244
let list: string[] = await util.readDir(vcpkgInstalledPath);
244245
if (list !== undefined) {
245246
// For every *directory* in the list (non-recursive). Each directory is basically a platform.

0 commit comments

Comments
 (0)