From 2b255619648eec600db99260f293167f1b0faed7 Mon Sep 17 00:00:00 2001 From: matz Date: Thu, 9 Apr 1998 09:58:00 +0000 Subject: 1.1b9_09 git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/v1_1r@161 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ChangeLog | 10 ++++++++++ Makefile.in | 2 +- lib/ftplib.rb | 20 +++++++++++--------- lib/jcode.rb | 4 ++-- re.c | 4 ---- version.h | 4 ++-- 6 files changed, 26 insertions(+), 18 deletions(-) diff --git a/ChangeLog b/ChangeLog index 049d2a898a..cc22029d36 100644 --- a/ChangeLog +++ b/ChangeLog @@ -18,6 +18,16 @@ Wed Apr 8 00:59:13 1998 Yukihiro Matsumoto * eval.c (f_local_variables): dyna_var->id may be null. should have checked before calling str_new2(). +Tue Apr 7 01:15:15 1998 Kaneko Naoshi + + * re.c (reg_regsub): need to check string boundary. + +Tue Apr 7 19:19:12 1998 Yukihiro Matsumoto + + * string.c (str_cmp): returns either 1, 0, -1. + + * array.c (ary_cmp): should check array length, too + Tue Apr 7 18:50:16 1998 Yukihiro Matsumoto * experimental release 1.1b9_08. diff --git a/Makefile.in b/Makefile.in index bafabdcf55..7ef78b30bc 100644 --- a/Makefile.in +++ b/Makefile.in @@ -203,6 +203,6 @@ st.o: st.c config.h st.h string.o: string.c ruby.h config.h defines.h intern.h re.h regex.h struct.o: struct.c ruby.h config.h defines.h intern.h time.o: time.c ruby.h config.h defines.h intern.h -util.o: util.c defines.h intern.h config.h util.h +util.o: util.c ruby.h defines.h intern.h config.h util.h variable.o: variable.c ruby.h config.h defines.h intern.h env.h st.h version.o: version.c ruby.h config.h defines.h intern.h version.h diff --git a/lib/ftplib.rb b/lib/ftplib.rb index b58a01cdaa..4069089cc3 100644 --- a/lib/ftplib.rb +++ b/lib/ftplib.rb @@ -389,19 +389,20 @@ class FTP return files end - def list(*args) + def list(*args, &block) cmd = "LIST" - if iterator? - callback = Proc.new - elsif args[-1].is_a?(Proc) - callback = args.pop - else - callback = nil - end args.each do |arg| cmd = cmd + " " + arg end - retrlines(cmd, callback) + if block + retrlines(cmd, &block) + else + lines = [] + retrlines(cmd) do |line| + lines << line + end + return lines + end end alias ls list alias dir list @@ -441,6 +442,7 @@ class FTP end def size(filename) + voidcmd("TYPE I") resp = sendcmd("SIZE " + filename) if resp[0, 3] == "213" return resp[3 .. -1].strip.to_i diff --git a/lib/jcode.rb b/lib/jcode.rb index d7c16a173c..6d71518c70 100644 --- a/lib/jcode.rb +++ b/lib/jcode.rb @@ -17,7 +17,7 @@ class String elsif $KCODE =~ /^e/i self =~ /[\xa1-\xfe][\xa1-\xfe]/n else - FALSE + false end end @@ -42,7 +42,7 @@ class String if self[0..-2] == to[0..-2] first = self[-2].chr for c in self[-1] .. to[-1] - if first+c.chr.mbchar? + if (first+c.chr).mbchar? yield self[0..-2]+c.chr end end diff --git a/re.c b/re.c index 336a40b35f..262b716c1a 100644 --- a/re.c +++ b/re.c @@ -913,10 +913,6 @@ reg_regsub(str, src, regs) if (no == 0) continue; break; - case '\\': - str_cat(val, s-1, 1); - continue; - default: str_cat(val, s-2, 2); continue; diff --git a/version.h b/version.h index a5aed14835..40779276c6 100644 --- a/version.h +++ b/version.h @@ -1,2 +1,2 @@ -#define RUBY_VERSION "1.1b9_08" -#define VERSION_DATE "98/04/07" +#define RUBY_VERSION "1.1b9_09" +#define VERSION_DATE "98/04/09" -- cgit v1.2.3