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)
if not thisline then
break
end
_,instcnt = string.lower(logentry.URL):gsub(format.escapemagiccharacters(thisline), " ")
if instcnt ~= 0 then
logentry.ignoreme = true
--logme("ignoring...")
break
-- ignore blank lines
if string.find(thisline, "%S") then
_,instcnt = string.lower(logentry.URL):gsub(format.escapemagiccharacters(thisline), " ")
if instcnt ~= 0 then
logentry.ignoreme = true
--logme("ignoring...")
break
end
end
end
......@@ -480,12 +484,15 @@ local function checkwords(logentry)
break
end
_,instcnt = string.lower(logentry.URL):gsub(format.escapemagiccharacters(thisline), " ")
if instcnt ~= 0 then
-- logme("instcnt = "..instcnt)
isbad=1
wrdcnt= wrdcnt + instcnt
badwordloc[#badwordloc+1] = thisline
-- ignore blank lines
if string.find(thisline, "%S") then
_,instcnt = string.lower(logentry.URL):gsub(format.escapemagiccharacters(thisline), " ")
if instcnt ~= 0 then
-- logme("instcnt = "..instcnt)
isbad=1
wrdcnt= wrdcnt + instcnt
badwordloc[#badwordloc+1] = thisline
end
end
end
......@@ -523,15 +530,19 @@ local function checkwords(logentry)
if not goodline then
break
end
_,instcnt = string.lower(logentry.URL):gsub(format.escapemagiccharacters(goodline), " ")
--if string.find(logentry.URL,goodline) then
if instcnt ~= 0 then
if wrdcnt >= instcnt then
wrdcnt = wrdcnt - instcnt
else
wrdcnt = 0
-- ignore blank lines
if string.find(thisline, "%S") then
_,instcnt = string.lower(logentry.URL):gsub(format.escapemagiccharacters(goodline), " ")
--if string.find(logentry.URL,goodline) then
if instcnt ~= 0 then
if wrdcnt >= instcnt then
wrdcnt = wrdcnt - instcnt
else
wrdcnt = 0
end
goodwordloc[#goodwordloc+1] = goodline
end
goodwordloc[#goodwordloc+1] = goodline
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