diff mod_pastebin/mod_pastebin.lua @ 3099:c88f91626e07

mod_pastebin: Off-by-one, the hardest problem known to man The threshold set to 4 allowed 4 lines and pastebinned 5. 040eaa3844f4 unintentionally changed this so that 4 lines were pastebinned. This commit restores the previous behavior.
author Kim Alvefur <zash@zash.se>
date Sun, 03 Jun 2018 14:09:30 +0200
parents 26977c4760f5
children 03cda95ae97a
line wrap: on
line diff
--- a/mod_pastebin/mod_pastebin.lua	Sun Jun 03 13:55:10 2018 +0200
+++ b/mod_pastebin/mod_pastebin.lua	Sun Jun 03 14:09:30 2018 +0200
@@ -95,7 +95,7 @@
 	end
 end
 
-local line_count_pattern = string.rep("[^\n]*\n", line_threshold):sub(1, -2);
+local line_count_pattern = string.rep("[^\n]*\n", line_threshold + 1):sub(1,-2);
 
 function check_message(data)
 	local stanza = data.stanza;