Skip to content

Commit 0ff6da1

Browse files
encodeURIs to make sure paths with spaces can be linked in output window (#4394)
1 parent ff9304b commit 0ff6da1

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

src/drivers/cmakeDriver.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -562,15 +562,15 @@ export abstract class CMakeDriver implements vscode.Disposable {
562562
const cache = this.cachePath;
563563
const cmake_files = this.config.deleteBuildDirOnCleanConfigure ? build_dir : path.join(build_dir, 'CMakeFiles');
564564
if (await fs.exists(cache)) {
565-
log.info(localize('removing', 'Removing {0}', cache));
565+
log.info(localize('removing', 'Removing {0}', encodeURI(cache)));
566566
try {
567567
await fs.unlink(cache);
568568
} catch {
569569
log.error(localize('unlink.failed', 'Failed to remove cache file {0}', this.cachePath));
570570
}
571571
}
572572
if (await fs.exists(cmake_files)) {
573-
log.info(localize('removing', 'Removing {0}', cmake_files));
573+
log.info(localize('removing', 'Removing {0}', encodeURI(cmake_files)));
574574
await fs.rmdir(cmake_files);
575575
}
576576
}

src/drivers/cmakeFileApiDriver.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -221,8 +221,8 @@ export class CMakeFileApiDriver extends CMakeDriver {
221221
}
222222
}
223223
// -S and -B were introduced in CMake 3.13 and this driver assumes CMake >= 3.15
224-
args.push(`-S${util.lightNormalizePath(this.sourceDir)}`);
225-
args.push(`-B${util.lightNormalizePath(binaryDir)}`);
224+
args.push("-S", `${encodeURI(util.lightNormalizePath(this.sourceDir))}`);
225+
args.push("-B", `${encodeURI(util.lightNormalizePath(binaryDir))}`);
226226

227227
if (!has_gen) {
228228
const generator = (configurePreset) ? {

src/presets/preset.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2255,10 +2255,10 @@ export function configureArgs(preset: ConfigurePreset): string[] {
22552255
}
22562256

22572257
if (preset.toolchainFile) {
2258-
result.push(`-DCMAKE_TOOLCHAIN_FILE=${preset.toolchainFile}`);
2258+
result.push(`-DCMAKE_TOOLCHAIN_FILE=${encodeURI(preset.toolchainFile)}`);
22592259
}
22602260
if (preset.installDir) {
2261-
result.push(`-DCMAKE_INSTALL_PREFIX=${preset.installDir}`);
2261+
result.push(`-DCMAKE_INSTALL_PREFIX=${encodeURI(preset.installDir)}`);
22622262
}
22632263

22642264
// Warnings

0 commit comments

Comments
 (0)