Skip to content

Commit 35a6e88

Browse files
committed
Fixing regex
1 parent af1d9fa commit 35a6e88

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

ext/tk/extconf.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -618,7 +618,7 @@ def libcheck_for_tclConfig(tcldir, tkdir, tclconf, tkconf)
618618
tk_regexp = /^.*(tk#{stub}#{tkver}.*)\.(#{exts}).*$/
619619
elsif tkconf
620620
tk_glob = "*tk#{stub}#{tkconf['TK_MAJOR_VERSION']}{.,}#{tkconf['TK_MINOR_VERSION']}*.*"
621-
tk_regexp = /^.*(tk#{stub}#{tkconf['TK_MAJOR_VERSION']}(?:\.|)#{tkconf['TK_MINOR_VERSION']}.*)\.#{exts}.*$/
621+
tk_regexp = /^(?:.*(tcl#{tclconf['TCL_MAJOR_VERSION']})|.*)(tk#{stub}#{tkconf['TK_MAJOR_VERSION']}(?:\.|)#{tkconf['TK_MINOR_VERSION']}.*)\.#{exts}.*$/
622622
end
623623

624624
tcllib_ok ||= !tclconf || Dir.glob(File.join(tcldir, tcl_glob), File::FNM_CASEFOLD).find{|file|
@@ -667,8 +667,8 @@ def libcheck_for_tclConfig(tcldir, tkdir, tclconf, tkconf)
667667

668668
tklib_ok ||= !tkconf || Dir.glob(File.join(tkdir, tk_glob), File::FNM_CASEFOLD).find{|file|
669669
if file =~ tk_regexp
670-
libname = $1
671-
ext = $2.downcase
670+
libname = ($1 || "") + $2
671+
ext = $3.downcase
672672
begin
673673
#puts "check #{file} #{$1} #{tkfunc} #{tkdir}"
674674
# find_library($1, tkfunc, tkdir)

0 commit comments

Comments
 (0)