Skip to content

Commit

Permalink
Fix issue with call to cpptools-wordexp with invalid arguments (#10070)
Browse files Browse the repository at this point in the history
  • Loading branch information
Colengms authored Oct 26, 2022
1 parent 6502f27 commit e8a33ff
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions Extension/src/common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1012,12 +1012,12 @@ function extractArgs(argsString: string): string[] {
}
return result;
} else {
const wordexpResult: any = child_process.execFileSync(getExtensionFilePath("bin/cpptools-wordexp"), [argsString]);
if (wordexpResult === undefined) {
return [];
}
const jsonText: string = wordexpResult.toString();
try {
const wordexpResult: any = child_process.execFileSync(getExtensionFilePath("bin/cpptools-wordexp"), [argsString], { shell: false });
if (wordexpResult === undefined) {
return [];
}
const jsonText: string = wordexpResult.toString();
return jsonc.parse(jsonText, undefined, true);
} catch {
return [];
Expand Down

0 comments on commit e8a33ff

Please sign in to comment.