Commit 68f37a3b authored by Ted Trask's avatar Ted Trask

Bug fix to ignore blank lines in word lists

parent 2085d5d5
...@@ -465,11 +465,15 @@ local function checkwords(logentry) ...@@ -465,11 +465,15 @@ local function checkwords(logentry)
if not thisline then if not thisline then
break break
end end
_,instcnt = string.lower(logentry.URL):gsub(format.escapemagiccharacters(thisline), " ")
if instcnt ~= 0 then -- ignore blank lines
logentry.ignoreme = true if string.find(thisline, "%S") then
--logme("ignoring...") _,instcnt = string.lower(logentry.URL):gsub(format.escapemagiccharacters(thisline), " ")
break if instcnt ~= 0 then
logentry.ignoreme = true
--logme("ignoring...")
break
end
end end
end end
...@@ -480,12 +484,15 @@ local function checkwords(logentry) ...@@ -480,12 +484,15 @@ local function checkwords(logentry)
break break
end end
_,instcnt = string.lower(logentry.URL):gsub(format.escapemagiccharacters(thisline), " ") -- ignore blank lines
if instcnt ~= 0 then if string.find(thisline, "%S") then
-- logme("instcnt = "..instcnt) _,instcnt = string.lower(logentry.URL):gsub(format.escapemagiccharacters(thisline), " ")
isbad=1 if instcnt ~= 0 then
wrdcnt= wrdcnt + instcnt -- logme("instcnt = "..instcnt)
badwordloc[#badwordloc+1] = thisline isbad=1
wrdcnt= wrdcnt + instcnt
badwordloc[#badwordloc+1] = thisline
end
end end
end end
...@@ -523,15 +530,19 @@ local function checkwords(logentry) ...@@ -523,15 +530,19 @@ local function checkwords(logentry)
if not goodline then if not goodline then
break break
end end
_,instcnt = string.lower(logentry.URL):gsub(format.escapemagiccharacters(goodline), " ")
--if string.find(logentry.URL,goodline) then -- ignore blank lines
if instcnt ~= 0 then if string.find(thisline, "%S") then
if wrdcnt >= instcnt then _,instcnt = string.lower(logentry.URL):gsub(format.escapemagiccharacters(goodline), " ")
wrdcnt = wrdcnt - instcnt --if string.find(logentry.URL,goodline) then
else if instcnt ~= 0 then
wrdcnt = 0 if wrdcnt >= instcnt then
wrdcnt = wrdcnt - instcnt
else
wrdcnt = 0
end
goodwordloc[#goodwordloc+1] = goodline
end end
goodwordloc[#goodwordloc+1] = goodline
end end
end end
end end
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment