summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog12
-rw-r--r--array.c4
-rw-r--r--error.c4
-rw-r--r--ext/nkf/depend2
-rw-r--r--ext/nkf/nkf.c22
-rw-r--r--ext/socket/extconf.rb5
-rw-r--r--ext/socket/socket.c2
-rw-r--r--lib/net/pop.rb23
-rw-r--r--lib/net/session.rb16
-rw-r--r--lib/net/smtp.rb4
-rw-r--r--ruby.c2
11 files changed, 65 insertions, 31 deletions
diff --git a/ChangeLog b/ChangeLog
index ed3db7fe27..2b63da2b9b 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,15 @@
+Mon Oct 18 16:15:52 1999 Yukihiro Matsumoto <matz@netlab.co.jp>
+
+ * ext/nkf/nkf.c (rb_nkf_kconv): output should be NUL terminated.
+
+Sun Oct 17 03:35:33 1999 Masaki Fukushima <fukusima@goto.info.waseda.ac.jp>
+
+ * array.c (rb_ary_pop): forgot some freeze checks.
+
+Fri Oct 15 22:50:41 1999 WATANABE Hirofumi <eban@os.rim.or.jp>
+
+ * error.c (sys_nerr): on CYGWIN, it is _sys_nerr.
+
Fri Oct 15 01:32:31 1999 WATANABE Hirofumi <eban@os.rim.or.jp>
* io.c (rb_io_ctl) :need to use NUM2ULONG, not NUM2INT.
diff --git a/array.c b/array.c
index b3c5fd45b6..793ea13baf 100644
--- a/array.c
+++ b/array.c
@@ -280,6 +280,7 @@ VALUE
rb_ary_pop(ary)
VALUE ary;
{
+ rb_ary_modify(ary);
if (RARRAY(ary)->len == 0) return Qnil;
if (RARRAY(ary)->len * 10 < RARRAY(ary)->capa && RARRAY(ary)->capa > ARY_DEFAULT_SIZE) {
RARRAY(ary)->capa = RARRAY(ary)->len * 2;
@@ -294,6 +295,7 @@ rb_ary_shift(ary)
{
VALUE top;
+ rb_ary_modify(ary);
if (RARRAY(ary)->len == 0) return Qnil;
top = RARRAY(ary)->ptr[0];
@@ -844,6 +846,7 @@ rb_ary_reverse(ary)
VALUE *p1, *p2;
VALUE tmp;
+ rb_ary_modify(ary);
if (RARRAY(ary)->len == 0) return ary;
p1 = RARRAY(ary)->ptr;
@@ -1026,6 +1029,7 @@ static VALUE
rb_ary_clear(ary)
VALUE ary;
{
+ rb_ary_modify(ary);
RARRAY(ary)->len = 0;
if (ARY_DEFAULT_SIZE*3 < RARRAY(ary)->capa) {
RARRAY(ary)->capa = ARY_DEFAULT_SIZE * 2;
diff --git a/error.c b/error.c
index 393603ff7a..1e53b9a653 100644
--- a/error.c
+++ b/error.c
@@ -26,6 +26,10 @@
int sys_nerr = 256;
#endif
+#if defined __CYGWIN__ && defined _sys_nerr
+#define sys_nerr _sys_nerr
+#endif
+
int ruby_nerrs;
static void
diff --git a/ext/nkf/depend b/ext/nkf/depend
index 645bc869c8..13e32e6074 100644
--- a/ext/nkf/depend
+++ b/ext/nkf/depend
@@ -1 +1 @@
-nkf.o : nkf.c $(hdrdir)/ruby.h $(topdir)/config.h $(hdrdir)/defines.h nkf1.7/nkf.c
+nkf.o : nkf.c $(hdrdir)/ruby.h $(topdir)/config.h $(hdrdir)/defines.h $(srcdir)/nkf1.7/nkf.c
diff --git a/ext/nkf/nkf.c b/ext/nkf/nkf.c
index 80d0d2e4be..cde0f7a9a6 100644
--- a/ext/nkf/nkf.c
+++ b/ext/nkf/nkf.c
@@ -31,14 +31,12 @@ rb_nkf_putchar(c)
{
if (output_ctr >= o_len) {
o_len += incsize;
- rb_str_cat(dst, "", incsize);
+ rb_str_cat(dst, 0, incsize);
+ output = RSTRING(dst)->ptr;
incsize *= 2;
}
-
output[output_ctr++] = c;
-/*
-printf("[[%c][%c][%d]]\n", c, output[output_ctr - 1], output_ctr);
-*/
+
return c;
}
@@ -78,18 +76,8 @@ rb_nkf_kconv(obj, opt, src)
}
kanji_convert(NULL);
- if (output_ctr > 0) output_ctr--;
- if (output[output_ctr] == '\0') {
-/*
-printf("([%c][%d])\n", output[output_ctr], output_ctr);
-*/
- RSTRING(dst)->len = output_ctr;
- } else {
-/*
-printf("<[%c][%d]>\n", output[output_ctr], output_ctr);
-*/
- RSTRING(dst)->len = output_ctr + 1;
- }
+ RSTRING(dst)->ptr[output_ctr] = '\0';
+ RSTRING(dst)->len = output_ctr;
return dst;
}
diff --git a/ext/socket/extconf.rb b/ext/socket/extconf.rb
index 47addfeff8..467c052a85 100644
--- a/ext/socket/extconf.rb
+++ b/ext/socket/extconf.rb
@@ -160,6 +160,10 @@ if try_run(<<EOF)
#include <sys/socket.h>
#include <netinet/in.h>
+#ifndef AF_LOCAL
+#define AF_LOCAL AF_UNIX
+#endif
+
main()
{
int passive, gaierr, inet4 = 0, inet6 = 0;
@@ -176,6 +180,7 @@ main()
goto bad;
}
for (ai = aitop; ai; ai = ai->ai_next) {
+ if (ai->ai_family == AF_LOCAL) continue;
if (ai->ai_addr == NULL ||
ai->ai_addrlen == 0 ||
getnameinfo(ai->ai_addr, ai->ai_addrlen,
diff --git a/ext/socket/socket.c b/ext/socket/socket.c
index a1d707122e..408257eeb6 100644
--- a/ext/socket/socket.c
+++ b/ext/socket/socket.c
@@ -890,7 +890,9 @@ tcp_s_gethostbyname(obj, host)
struct sockaddr_in6 sin6;
MEMZERO(&sin6, struct sockaddr_in6, 1);
sin6.sin6_family = AF_INET;
+#ifdef SIN6_LEN
sin6.sin6_len = sizeof(sin6);
+#endif
memcpy((char *) &sin6.sin6_addr, *pch, h->h_length);
h = gethostbyaddr((char *)&sin6.sin6_addr,
sizeof(sin6.sin6_addr),
diff --git a/lib/net/pop.rb b/lib/net/pop.rb
index c492a4cd20..547dafbbcc 100644
--- a/lib/net/pop.rb
+++ b/lib/net/pop.rb
@@ -1,6 +1,6 @@
=begin
-= Net module version 1.0.2 reference manual
+= Net module version 1.0.3 reference manual
pop.rb written by Minero Aoki <aamine@dp.u-netsurf.ne.jp>
@@ -167,6 +167,10 @@ Object
@deleted
end
+ def uidl
+ @proto.uidl @num
+ end
+
end
end # POP3Session
@@ -219,6 +223,11 @@ Net::Command
class POP3Command < Command
+ def initialize( sock )
+ @uidl = nil
+ super
+ end
+
=begin
@@ -323,11 +332,19 @@ Net::Command
def dele( num )
- @socket.writeline( sprintf( 'DELE %s', num ) )
+ @socket.writeline( 'DELE ' + num.to_s )
check_reply( SuccessCode )
end
+ def uidl( num )
+ @socket.writeline( 'UIDL ' + num.to_s )
+ rep = check_reply( SuccessCode )
+ uid = rep.msg.split(' ')[1]
+
+ uid
+ end
+
private
@@ -412,7 +429,7 @@ POP3
end
- unless Session::Version == '1.0.2' then
+ unless Session::Version == '1.0.3' then
$stderr.puts "WARNING: wrong version of session.rb & pop.rb"
end
diff --git a/lib/net/session.rb b/lib/net/session.rb
index 3f7ef7f51f..3863d8506e 100644
--- a/lib/net/session.rb
+++ b/lib/net/session.rb
@@ -1,6 +1,6 @@
=begin
-= Net module version 1.0.2 reference manual
+= Net module version 1.0.3 reference manual
session.rb written by Minero Aoki <aamine@dp.u-netsurf.ne.jp>
@@ -39,7 +39,7 @@ Object
: Version
- The version of Session class. It is a string like "1.0.2".
+ The version of Session class. It is a string like "1.0.3".
=end
@@ -48,7 +48,7 @@ module Net
class Session
- Version = '1.0.2'
+ Version = '1.0.3'
=begin
@@ -71,7 +71,9 @@ module Net
proto_initialize
@address = addr
@port = port if port
+
@active = false
+ @pipe = nil
end
class << self
@@ -133,12 +135,12 @@ module Net
return false if active?
@active = true
- if ProtocolSocket === args[0] then
- @socket = args.shift
- @socket.pipe = @pipe
+ if Class === args[0] then
+ c = args.shift
else
- @socket = ProtocolSocket.open( @address, @port, @pipe )
+ c = ProtocolSocket
end
+ @socket = c.open( @address, @port, @pipe )
@pipe = nil
@proto = @proto_type.new( @socket )
diff --git a/lib/net/smtp.rb b/lib/net/smtp.rb
index de97feaa23..6294512ffc 100644
--- a/lib/net/smtp.rb
+++ b/lib/net/smtp.rb
@@ -1,6 +1,6 @@
=begin
-= Net module version 1.0.2 reference manual
+= Net module version 1.0.3 reference manual
smtp.rb written by Minero Aoki <aamine@dp.u-netsurf.ne.jp>
@@ -212,7 +212,7 @@ Net::Command
end
- unless Session::Version == '1.0.2' then
+ unless Session::Version == '1.0.3' then
$stderr.puts "WARNING: wrong version of session.rb & smtp.rb"
end
diff --git a/ruby.c b/ruby.c
index bb3741d4e1..12aa708fb0 100644
--- a/ruby.c
+++ b/ruby.c
@@ -655,6 +655,7 @@ load_file(fname, script)
while (p < pend && ISSPACE(*p))
p++;
path = p; /* interpreter path */
+#ifndef USE_CWGUSI
while (p < pend && !ISSPACE(*p))
p++;
*p++ = '\0';
@@ -667,7 +668,6 @@ load_file(fname, script)
argv = origargv;
}
argv[0] = path;
-#ifndef USE_CWGUSI
execv(path, argv);
#endif
ruby_sourcefile = fname;