Skip to content

Commit 38ec521

Browse files
committed
Improve debugAdapterEnv's regex
1 parent 265efab commit 38ec521

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

lldb/tools/lldb-dap/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -422,7 +422,7 @@
422422
"markdownDescription": "Additional environment variables to set when launching the debug adapter executable. E.g. `[\"FOO=1\", \"BAR\"]`",
423423
"items": {
424424
"type": "string",
425-
"pattern": "^((\\w+=.*)|^\\w+)$"
425+
"pattern": "^\\w+(=.*)?$"
426426
},
427427
"default": []
428428
}
@@ -689,7 +689,7 @@
689689
"markdownDescription": "Additional environment variables to set when launching the debug adapter executable. E.g. `[\"FOO=1\", \"BAR\"]`",
690690
"items": {
691691
"type": "string",
692-
"pattern": "^((\\w+=.*)|^\\w+)$"
692+
"pattern": "^\\w+(=.*)?$"
693693
},
694694
"default": []
695695
}

lldb/tools/lldb-dap/src-ts/debug-adapter-factory.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ function validateDAPEnv(debugConfigEnv: any): boolean {
9292
Array.isArray(debugConfigEnv) &&
9393
debugConfigEnv.findIndex(
9494
(entry) =>
95-
typeof entry !== "string" || !/^((\\w+=.*)|^\\w+)$/.test(entry),
95+
typeof entry !== "string" || !/^\w+(=.*)?$/.test(entry),
9696
) !== -1
9797
) {
9898
return false;

0 commit comments

Comments
 (0)