From 00a6ea64673847eaa0feddc9c8f55eacc09cf25c Mon Sep 17 00:00:00 2001 From: Nicolas Stepien Date: Sun, 18 Dec 2011 03:00:14 +0100 Subject: [PATCH] match never returns empty arrays. Actually fix #61. --- 4chan_x.user.js | 2 +- script.coffee | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/4chan_x.user.js b/4chan_x.user.js index e991fc2a7..bc072f9ba 100644 --- a/4chan_x.user.js +++ b/4chan_x.user.js @@ -2231,7 +2231,7 @@ sauce = { init: function() { - if (!(sauce.prefixes = conf['flavors'].match(/^[^#].+$/gm)).length) return; + if (!(sauce.prefixes = conf['flavors'].match(/^[^#].+$/gm))) return; sauce.names = sauce.prefixes.map(function(prefix) { return prefix.match(/(\w+)\./)[1]; }); diff --git a/script.coffee b/script.coffee index 0a0394d2d..b703a1350 100644 --- a/script.coffee +++ b/script.coffee @@ -1790,7 +1790,7 @@ anonymize = sauce = init: -> - return unless (sauce.prefixes = conf['flavors'].match /^[^#].+$/gm).length + return unless sauce.prefixes = conf['flavors'].match /^[^#].+$/gm sauce.names = sauce.prefixes.map (prefix) -> prefix.match(/(\w+)\./)[1] g.callbacks.push (root) -> return if root.className is 'inline' or not span = $ '.filesize', root