summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog2
-rw-r--r--sample/mkproto.rb4
2 files changed, 4 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index 6f5539a..21b946d 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -2,6 +2,8 @@ Fri Jul 26 16:01:16 2002 WATANABE Hirofumi <eban@ruby-lang.org>
* ext/extmk.rb.in (create_makefile): use Regexp in gsub.
+ * sample/mkproto.rb: ditto and fix bug.
+
Fri Jul 26 14:31:06 2002 Yukihiro Matsumoto <matz@ruby-lang.org>
* random.c: replace with Mersenne Twister RNG.
diff --git a/sample/mkproto.rb b/sample/mkproto.rb
index e1d49be3..754ca2d 100644
--- a/sample/mkproto.rb
+++ b/sample/mkproto.rb
@@ -1,11 +1,11 @@
$/ = nil
while line = gets()
if /^((void|VALUE|int|char *\*|ID|struct [\w_]+ *\*|st_table *\*) *)?\n([\w\d_]+)\(.*\)\n\s*((.+;\n)*)\{/ =~ line
- $_ = $'
+ line = $'
printf "%s %s(", $2, $3
args = []
for arg in $4.split(/;\n\s*/)
- arg.gsub! ' +', ' '
+ arg.gsub!(/ +/, ' ')
if arg =~ /,/
if arg =~ /(([^*]+) *\** *[\w\d_]+),/
type = $2.strip