From f8f7e1d6ec62741c25c60ebdd71f7222db8af92c Mon Sep 17 00:00:00 2001 From: Michele Calgaro Date: Fri, 26 Oct 2018 22:49:45 +0900 Subject: Fixed SEGFAULT when using ruby bindings. Signed-off-by: Michele Calgaro --- tqtruby/rubylib/tqtruby/lib/TQt/tqtruby.rb | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/tqtruby/rubylib/tqtruby/lib/TQt/tqtruby.rb b/tqtruby/rubylib/tqtruby/lib/TQt/tqtruby.rb index a7489820..4788d01b 100644 --- a/tqtruby/rubylib/tqtruby/lib/TQt/tqtruby.rb +++ b/tqtruby/rubylib/tqtruby/lib/TQt/tqtruby.rb @@ -1349,14 +1349,14 @@ module TQt @@idclass = [] def Internal.normalize_classname(classname) - if classname =~ /^Qext/ - now = classname.sub(/^Qext(?=[A-Z])/,'Qext::') - elsif classname =~ /^Q/ - now = classname.sub(/^Q(?=[A-Z])/,'TQt::') + if classname =~ /^TQext/ + now = classname.sub(/^TQext(?=[A-Z])/,'TQext::') + elsif classname =~ /^TQ/ + now = classname.sub(/^TQ(?=[A-Z])/,'TQt::') elsif classname =~ /^(TDEConfigSkeleton|KWin)::/ - now = classname.sub(/^K?(?=[A-Z])/,'KDE::') + now = classname.sub(/^T?(?=[A-Z])/,'TDE::') elsif classname !~ /::/ - now = classname.sub(/^K?(?=[A-Z])/,'KDE::') + now = classname.sub(/^T?(?=[A-Z])/,'TDE::') else now = classname end @@ -1416,7 +1416,7 @@ module TQt elsif argtype == 's' if typename =~ /^(const )?((TQChar)[*&]?)$/ return 1 - elsif typename =~ /^(?:u?char\*|const u?char\*|(?:const )?(Q(C?)String)[*&]?)$/ + elsif typename =~ /^(?:u?char\*|const u?char\*|(?:const )?(TQ(C?)String)[*&]?)$/ qstring = !$1.nil? c = ("C" == $2) return c ? 2 : (qstring ? 3 : 0) @@ -1437,7 +1437,7 @@ module TQt end elsif argtype == 'u' # Give nil matched against string types a higher score than anything else - if typename =~ /^(?:u?char\*|const u?char\*|(?:const )?((Q(C?)String))[*&]?)$/ + if typename =~ /^(?:u?char\*|const u?char\*|(?:const )?((TQ(C?)String))[*&]?)$/ return 1 # Numerics will give a runtime conversion error, so they fail the match elsif typename =~ /^(?:short|ushort|uint|long|ulong|signed|unsigned|int)$/ -- cgit v1.2.3