From 62364427837ec8044ffce038b77341b670883420 Mon Sep 17 00:00:00 2001 From: XadillaX Date: Thu, 24 Feb 2022 20:47:15 +0800 Subject: [PATCH 1/2] url: remove a line of dead code --- src/node_url.cc | 1 - 1 file changed, 1 deletion(-) diff --git a/src/node_url.cc b/src/node_url.cc index 6e47acf7ae3c3f..e6861042800c28 100644 --- a/src/node_url.cc +++ b/src/node_url.cc @@ -932,7 +932,6 @@ void URL::Parse(const char* input, url->flags &= ~URL_FLAGS_SPECIAL; special = false; } - special_back_slash = (special && ch == '\\'); buffer.clear(); if (has_state_override) return; From 7b6d02d496587d1ad6df37ada5beaf9377e60faa Mon Sep 17 00:00:00 2001 From: Khaidi Chu Date: Mon, 28 Feb 2022 11:05:33 +0800 Subject: [PATCH 2/2] Update node_url.cc --- src/node_url.cc | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/node_url.cc b/src/node_url.cc index e6861042800c28..59abbe43f9917d 100644 --- a/src/node_url.cc +++ b/src/node_url.cc @@ -932,6 +932,10 @@ void URL::Parse(const char* input, url->flags &= ~URL_FLAGS_SPECIAL; special = false; } + // `special_back_slash` equals to `(special && ch == '\\')` and `ch` + // here always not equals to `\\`. So `special_back_slash` here always + // equals to `false`. + special_back_slash = false; buffer.clear(); if (has_state_override) return;