Skip to content

Commit

Permalink
stricter score.is_exact()
Browse files Browse the repository at this point in the history
  • Loading branch information
wtsnjp committed Sep 21, 2021
1 parent 351394f commit 3fc1123
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
2 changes: 1 addition & 1 deletion Rakefile
Expand Up @@ -235,7 +235,7 @@ desc "Save some outputs of Texdoc"
task :save_output => [PS_TEXDOC_LINK, PS_TEXDOC_CNF_LINK, OUTPUT_DIR] do
# settings
@output_file = OUTPUT_DIR / DateTime.now.strftime('%Y%m%d-%H%M%S.txt')
queries = %w(texlive-en texdoc bxjscls tikz latex vntex)
queries = %w(texlive-en texdoc bxjscls tikz latex vntex einfart)

def file_puts msg=""
File.open(@output_file, 'a') do |file|
Expand Down
13 changes: 7 additions & 6 deletions script/texdoclib-score.tlu
Expand Up @@ -82,11 +82,6 @@ local function is_subword(str, pat)
and (j == #str or is_delim(str, j) or is_delim(str, j+1)))
end

-- says if str2 is a suffix of str1
local function is_suffix(str1, str2)
return str1:sub(-#str2) == str2
end

-- says if a filename has a bad basename
local function has_bad_basename(file)
file = file:gsub('.*/', '')
Expand Down Expand Up @@ -280,7 +275,13 @@ function M.is_exact(filename, pattern)
end

-- finally check the bases
return is_suffix(f_base, p_base)
if (f_base == p_base
or (f_base:sub(-#p_base) == p_base
and f_base:sub(-#p_base - 1, -#p_base - 1) == '/')) then
return true
else
return false
end
end

-- compare two docfile's: (see texdoclib-search.tlu for structure)
Expand Down

0 comments on commit 3fc1123

Please sign in to comment.