Changeset

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 3098:a81456a13797
children 3100:0422fb55cc37
files mod_pastebin/mod_pastebin.lua
diffstat 1 files changed, 1 insertions(+), 1 deletions(-) [+]
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;