зеркало из https://github.com/github/ruby.git
19991018
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@546 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
Родитель
40a3f601e4
Коммит
125ca1a11a
12
ChangeLog
12
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.
|
||||
|
|
4
array.c
4
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;
|
||||
|
|
4
error.c
4
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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -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),
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
|
@ -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 )
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
2
ruby.c
2
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;
|
||||
|
|
Загрузка…
Ссылка в новой задаче