summaryrefslogtreecommitdiffstats
path: root/tools/genruby.rb
diff options
context:
space:
mode:
Diffstat (limited to 'tools/genruby.rb')
-rwxr-xr-xtools/genruby.rb8
1 files changed, 3 insertions, 5 deletions
diff --git a/tools/genruby.rb b/tools/genruby.rb
index eefe0d2..fe17174 100755
--- a/tools/genruby.rb
+++ b/tools/genruby.rb
@@ -42,11 +42,9 @@ def get_type_from_arg arg, l
if arg =~ /\.\.\./
return ':varargs'
end
- k = arg.gsub(/const/,'').gsub(/\s{2,}/,' ').strip
- if k=~/(.*?)(\w+)$/
- return get_type $1.strip
- end
- # try with unchanged argument string
+ k = arg.gsub(/const/,'').sub(/^\s+/,'').gsub(/\s{2,}/,' ').strip
+ k=~/(.*?)(\w+)$/ # remove var name if any
+ k = $1.strip if not $1.nil? and $1.length > 0
t = get_type k
if t.nil?
printf "\033[0;31mwrong arg >#{k}< #{arg} (#{l})\033[0m\n"