<commit_before>From 4f735dff87ce2a1a61822ddadd7f64aa69562cb3 Mon Sep 17 00:00:00 2001
From: <NAME> <<EMAIL>>
Date: Tue, 14 Oct 2014 15:26:52 -0700
Subject: [PATCH] Handle cookies with '=' in value part

Example: "foo=bar=baz" has the value "bar=baz".
---
 index.js | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/index.js b/index.js
index 21a2118..50a1a6c 100644
--- a/index.js
+++ b/index.js
@@ -7,9 +7,9 @@ var exports = module.exports = function (doc) {
     self.get = function (key) {
         var splat = doc.cookie.split(/;\s*/);
         for (var i = 0; i < splat.length; i++) {
-            var ps = splat[i].split('=');
-            var k = unescape(ps[0]);
-            if (k === key) return unescape(ps[1]);
+            var m = /(.*?)=(.*)/.exec(splat[i]);
+            var k = unescape(m[1]);
+            if (k === key) return unescape(m[2]);<commit_msg>Handle case of no cookies<commit_after>From 4e90755a97e9e626fb4c5951de7bbcfe7680c15c Mon Sep 17 00:00:00 2001
From: <NAME> <<EMAIL>>
Date: Tue, 14 Oct 2014 15:26:52 -0700
Subject: [PATCH] Handle cookies with '=' in value part

Example: "foo=bar=baz" has the value "bar=baz".
---
 index.js | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/index.js b/index.js
index 21a2118..1bf8d14 100644
--- a/index.js
+++ b/index.js
@@ -7,9 +7,10 @@ var exports = module.exports = function (doc) {
     self.get = function (key) {
         var splat = doc.cookie.split(/;\s*/);
         for (var i = 0; i < splat.length; i++) {
-            var ps = splat[i].split('=');
-            var k = unescape(ps[0]);
-            if (k === key) return unescape(ps[1]);
+            var m = /(.*?)=(.*)/.exec(splat[i]);
+            if (!m) continue;
+            var k = unescape(m[1]);
+            if (k === key) return unescape(m[2]);
{'fraction_non_alphanumeric': 0.19509536784741144, 'fraction_numerical': 0.08773841961852862, 'mean_word_length': 2.4641509433962265, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7554288', 'n_tokens_mistral': 800, 'n_tokens_neox': 685, 'n_words': 188}