From 95bf25f8009e474f7abf69fbf55267c6cd456eeb Mon Sep 17 00:00:00 2001 From: Artem Zatsarynnyi Date: Tue, 20 Sep 2022 16:34:35 +0200 Subject: [PATCH] `server-main.js` should respect the `--port` argument (#161254) After https://github.com/microsoft/vscode/pull/160094 merged, `server-main.js` ignores the `--port` argument. This patch fixes the problem. --- src/server-main.js | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/server-main.js b/src/server-main.js index 4e806323689..27ecbaed0d6 100644 --- a/src/server-main.js +++ b/src/server-main.js @@ -188,14 +188,10 @@ function sanitizeStringArg(val) { * @throws */ async function parsePort(host, strPort) { - let specificPort; if (strPort) { let range; if (strPort.match(/^\d+$/)) { - specificPort = parseInt(strPort, 10); - if (specificPort === 0) { - return specificPort; - } + return parseInt(strPort, 10); } else if (range = parseRange(strPort)) { const port = await findFreePort(host, range.start, range.end); if (port !== undefined) {