matz
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@952 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
616c1cd971
commit
b35df6aae2
21
ChangeLog
21
ChangeLog
@ -1,3 +1,19 @@
|
|||||||
|
Thu Sep 21 17:23:05 2000 Yukihiro Matsumoto <matz@ruby-lang.org>
|
||||||
|
|
||||||
|
* file.c (rb_file_s_symlink): use HAVE_SYMLINK.
|
||||||
|
|
||||||
|
* file.c (rb_file_s_readlink): use HAVE_READLINK.
|
||||||
|
|
||||||
|
* dir.c (dir_tell): use HAVE_TELLDIR.
|
||||||
|
|
||||||
|
* dir.c (dir_seek): use HAVE_SEEKDIR.
|
||||||
|
|
||||||
|
* configure.in (AC_CHECK_FUNCS): lstat, symlink, readlink,
|
||||||
|
telldir, seekdir checks added.
|
||||||
|
|
||||||
|
* file.c (lstat): should use stat(2) if lstat(2) is not
|
||||||
|
available.
|
||||||
|
|
||||||
Thu Sep 21 15:59:23 2000 Minero Aoki <aamine@dp.u-netsurf.ne.jp>
|
Thu Sep 21 15:59:23 2000 Minero Aoki <aamine@dp.u-netsurf.ne.jp>
|
||||||
|
|
||||||
* lib/net/protocol.rb, smtp.rb, pop.rb, http.rb: 1.1.28.
|
* lib/net/protocol.rb, smtp.rb, pop.rb, http.rb: 1.1.28.
|
||||||
@ -6,6 +22,11 @@ Thu Sep 21 15:59:23 2000 Minero Aoki <aamine@dp.u-netsurf.ne.jp>
|
|||||||
|
|
||||||
* lib/net/http.rb (connecting): response is got in receive()
|
* lib/net/http.rb (connecting): response is got in receive()
|
||||||
|
|
||||||
|
Thu Sep 21 15:49:07 2000 Wayne Scott <wscott@ichips.intel.com>
|
||||||
|
|
||||||
|
* lib/find.rb (find): should not follow symbolic links;
|
||||||
|
tuned performance too.
|
||||||
|
|
||||||
Wed Sep 20 23:21:38 2000 Yukihiro Matsumoto <matz@ruby-lang.org>
|
Wed Sep 20 23:21:38 2000 Yukihiro Matsumoto <matz@ruby-lang.org>
|
||||||
|
|
||||||
* ruby.c (load_file): two Ctrl-D was required to stop ruby at the
|
* ruby.c (load_file): two Ctrl-D was required to stop ruby at the
|
||||||
|
@ -230,10 +230,10 @@ AC_REPLACE_FUNCS(dup2 memmove mkdir strcasecmp strncasecmp strerror strftime\
|
|||||||
strchr strstr strtoul crypt flock vsnprintf\
|
strchr strstr strtoul crypt flock vsnprintf\
|
||||||
isinf isnan finite)
|
isinf isnan finite)
|
||||||
AC_CHECK_FUNCS(fmod killpg drand48 random wait4 waitpid syscall getcwd chroot\
|
AC_CHECK_FUNCS(fmod killpg drand48 random wait4 waitpid syscall getcwd chroot\
|
||||||
truncate chsize times utimes fcntl lockf setitimer pause\
|
truncate chsize times utimes fcntl lockf lstat symlink readlink\
|
||||||
setruid seteuid setreuid setrgid setegid setregid\
|
setitimer setruid seteuid setreuid setrgid setegid setregid pause\
|
||||||
getpgrp setpgrp getpgid setpgid getgroups getpriority\
|
getpgrp setpgrp getpgid setpgid getgroups getpriority getrlimit\
|
||||||
dlopen sigprocmask sigaction _setjmp setsid getrlimit)
|
dlopen sigprocmask sigaction _setjmp setsid telldir seekdir)
|
||||||
AC_STRUCT_TIMEZONE
|
AC_STRUCT_TIMEZONE
|
||||||
AC_CACHE_CHECK(for external int daylight, rb_cv_have_daylight,
|
AC_CACHE_CHECK(for external int daylight, rb_cv_have_daylight,
|
||||||
[AC_TRY_LINK([#include <time.h>
|
[AC_TRY_LINK([#include <time.h>
|
||||||
|
4
dir.c
4
dir.c
@ -334,7 +334,7 @@ static VALUE
|
|||||||
dir_tell(dir)
|
dir_tell(dir)
|
||||||
VALUE dir;
|
VALUE dir;
|
||||||
{
|
{
|
||||||
#if !defined(__CYGWIN32__) && !defined(__BEOS__)
|
#ifdef HAVE_TELLDIR
|
||||||
DIR *dirp;
|
DIR *dirp;
|
||||||
long pos;
|
long pos;
|
||||||
|
|
||||||
@ -352,7 +352,7 @@ dir_seek(dir, pos)
|
|||||||
{
|
{
|
||||||
DIR *dirp;
|
DIR *dirp;
|
||||||
|
|
||||||
#if !defined(__CYGWIN32__) && !defined(__BEOS__)
|
#ifdef HAVE_SEEKDIR
|
||||||
GetDIR(dir, dirp);
|
GetDIR(dir, dirp);
|
||||||
seekdir(dirp, NUM2INT(pos));
|
seekdir(dirp, NUM2INT(pos));
|
||||||
return dir;
|
return dir;
|
||||||
|
21
file.c
21
file.c
@ -66,7 +66,7 @@ char *strrchr _((const char*,const char));
|
|||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
#include <sys/stat.h>
|
#include <sys/stat.h>
|
||||||
|
|
||||||
#ifdef __EMX__
|
#ifndef HAVE_LSTAT
|
||||||
#define lstat stat
|
#define lstat stat
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -348,7 +348,7 @@ static VALUE
|
|||||||
rb_file_s_lstat(obj, fname)
|
rb_file_s_lstat(obj, fname)
|
||||||
VALUE obj, fname;
|
VALUE obj, fname;
|
||||||
{
|
{
|
||||||
#if !defined(MSDOS) && !defined(NT) && !defined(__EMX__)
|
#ifdef HAVE_LSTAT
|
||||||
struct stat st;
|
struct stat st;
|
||||||
|
|
||||||
Check_SafeStr(fname);
|
Check_SafeStr(fname);
|
||||||
@ -357,8 +357,7 @@ rb_file_s_lstat(obj, fname)
|
|||||||
}
|
}
|
||||||
return stat_new(&st);
|
return stat_new(&st);
|
||||||
#else
|
#else
|
||||||
rb_notimplement();
|
return rb_file_s_stat(obj, fname);
|
||||||
return Qnil; /* not reached */
|
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -366,7 +365,7 @@ static VALUE
|
|||||||
rb_file_lstat(obj)
|
rb_file_lstat(obj)
|
||||||
VALUE obj;
|
VALUE obj;
|
||||||
{
|
{
|
||||||
#if !defined(MSDOS) && !defined(NT)
|
#ifdef HAVE_LSTAT
|
||||||
OpenFile *fptr;
|
OpenFile *fptr;
|
||||||
struct stat st;
|
struct stat st;
|
||||||
|
|
||||||
@ -378,8 +377,7 @@ rb_file_lstat(obj)
|
|||||||
}
|
}
|
||||||
return stat_new(&st);
|
return stat_new(&st);
|
||||||
#else
|
#else
|
||||||
rb_notimplement();
|
return rb_io_stat(obj);
|
||||||
return Qnil; /* not reached */
|
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -822,15 +820,10 @@ rb_file_s_ftype(obj, fname)
|
|||||||
{
|
{
|
||||||
struct stat st;
|
struct stat st;
|
||||||
|
|
||||||
#if defined(MSDOS) || defined(NT)
|
|
||||||
if (rb_stat(fname, &st) < 0)
|
|
||||||
rb_sys_fail(RSTRING(fname)->ptr);
|
|
||||||
#else
|
|
||||||
Check_SafeStr(fname);
|
Check_SafeStr(fname);
|
||||||
if (lstat(RSTRING(fname)->ptr, &st) == -1) {
|
if (lstat(RSTRING(fname)->ptr, &st) == -1) {
|
||||||
rb_sys_fail(RSTRING(fname)->ptr);
|
rb_sys_fail(RSTRING(fname)->ptr);
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
return rb_file_ftype(&st);
|
return rb_file_ftype(&st);
|
||||||
}
|
}
|
||||||
@ -1119,7 +1112,7 @@ static VALUE
|
|||||||
rb_file_s_symlink(obj, from, to)
|
rb_file_s_symlink(obj, from, to)
|
||||||
VALUE obj, from, to;
|
VALUE obj, from, to;
|
||||||
{
|
{
|
||||||
#if !defined(MSDOS) && !defined(NT) && !defined(__EMX__) && !defined(riscos)
|
#ifdef HAVE_SYMLINK
|
||||||
Check_SafeStr(from);
|
Check_SafeStr(from);
|
||||||
Check_SafeStr(to);
|
Check_SafeStr(to);
|
||||||
|
|
||||||
@ -1136,7 +1129,7 @@ static VALUE
|
|||||||
rb_file_s_readlink(obj, path)
|
rb_file_s_readlink(obj, path)
|
||||||
VALUE obj, path;
|
VALUE obj, path;
|
||||||
{
|
{
|
||||||
#if !defined(MSDOS) && !defined(NT) && !defined(__EMX__) && !defined(riscos)
|
#ifdef READLINK
|
||||||
char buf[MAXPATHLEN];
|
char buf[MAXPATHLEN];
|
||||||
int cc;
|
int cc;
|
||||||
|
|
||||||
|
2
io.c
2
io.c
@ -2792,7 +2792,7 @@ rb_io_ctl(io, req, arg, io_p)
|
|||||||
#ifdef HAVE_FCNTL
|
#ifdef HAVE_FCNTL
|
||||||
TRAP_BEG;
|
TRAP_BEG;
|
||||||
# if defined(__CYGWIN__)
|
# if defined(__CYGWIN__)
|
||||||
retval = io_p?ioctl(fd, cmd, (void*) narg):fcntl(fd, cmd, narg);
|
retval = io_p?ioctl(fd, cmd, (void*)narg):fcntl(fd, cmd, narg);
|
||||||
# else
|
# else
|
||||||
retval = io_p?ioctl(fd, cmd, narg):fcntl(fd, cmd, narg);
|
retval = io_p?ioctl(fd, cmd, narg):fcntl(fd, cmd, narg);
|
||||||
# endif
|
# endif
|
||||||
|
@ -12,17 +12,17 @@ module Find
|
|||||||
while file = path.shift
|
while file = path.shift
|
||||||
catch(:prune) {
|
catch(:prune) {
|
||||||
yield file
|
yield file
|
||||||
if File.directory? file then
|
if File.lstat(file).directory? then
|
||||||
d = Dir.open(file)
|
d = Dir.open(file)
|
||||||
begin
|
begin
|
||||||
for f in d
|
for f in d
|
||||||
next if f =~ /\A\.\.?\z/
|
next if f == "." or f == ".."
|
||||||
if File::ALT_SEPARATOR and file =~ /^([\/\\]|[A-Za-z]:[\/\\]?)$/ then
|
if File::ALT_SEPARATOR and file =~ /^(?:[\/\\]|[A-Za-z]:[\/\\]?)$/ then
|
||||||
f = file + f
|
f = file + f
|
||||||
elsif file == "/" then
|
elsif file == "/" then
|
||||||
f = "/" + f
|
f = "/" + f
|
||||||
else
|
else
|
||||||
f = file + "/" + f
|
f = File.join(file, f)
|
||||||
end
|
end
|
||||||
path.unshift f
|
path.unshift f
|
||||||
end
|
end
|
||||||
|
Loading…
x
Reference in New Issue
Block a user