mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
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
6 changed files with 39 additions and 25 deletions
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>
|
||||
|
||||
* 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()
|
||||
|
||||
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>
|
||||
|
||||
* 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\
|
||||
isinf isnan finite)
|
||||
AC_CHECK_FUNCS(fmod killpg drand48 random wait4 waitpid syscall getcwd chroot\
|
||||
truncate chsize times utimes fcntl lockf setitimer pause\
|
||||
setruid seteuid setreuid setrgid setegid setregid\
|
||||
getpgrp setpgrp getpgid setpgid getgroups getpriority\
|
||||
dlopen sigprocmask sigaction _setjmp setsid getrlimit)
|
||||
truncate chsize times utimes fcntl lockf lstat symlink readlink\
|
||||
setitimer setruid seteuid setreuid setrgid setegid setregid pause\
|
||||
getpgrp setpgrp getpgid setpgid getgroups getpriority getrlimit\
|
||||
dlopen sigprocmask sigaction _setjmp setsid telldir seekdir)
|
||||
AC_STRUCT_TIMEZONE
|
||||
AC_CACHE_CHECK(for external int daylight, rb_cv_have_daylight,
|
||||
[AC_TRY_LINK([#include <time.h>
|
||||
|
|
4
dir.c
4
dir.c
|
@ -334,7 +334,7 @@ static VALUE
|
|||
dir_tell(dir)
|
||||
VALUE dir;
|
||||
{
|
||||
#if !defined(__CYGWIN32__) && !defined(__BEOS__)
|
||||
#ifdef HAVE_TELLDIR
|
||||
DIR *dirp;
|
||||
long pos;
|
||||
|
||||
|
@ -352,7 +352,7 @@ dir_seek(dir, pos)
|
|||
{
|
||||
DIR *dirp;
|
||||
|
||||
#if !defined(__CYGWIN32__) && !defined(__BEOS__)
|
||||
#ifdef HAVE_SEEKDIR
|
||||
GetDIR(dir, dirp);
|
||||
seekdir(dirp, NUM2INT(pos));
|
||||
return dir;
|
||||
|
|
21
file.c
21
file.c
|
@ -66,7 +66,7 @@ char *strrchr _((const char*,const char));
|
|||
#include <sys/types.h>
|
||||
#include <sys/stat.h>
|
||||
|
||||
#ifdef __EMX__
|
||||
#ifndef HAVE_LSTAT
|
||||
#define lstat stat
|
||||
#endif
|
||||
|
||||
|
@ -348,7 +348,7 @@ static VALUE
|
|||
rb_file_s_lstat(obj, fname)
|
||||
VALUE obj, fname;
|
||||
{
|
||||
#if !defined(MSDOS) && !defined(NT) && !defined(__EMX__)
|
||||
#ifdef HAVE_LSTAT
|
||||
struct stat st;
|
||||
|
||||
Check_SafeStr(fname);
|
||||
|
@ -357,8 +357,7 @@ rb_file_s_lstat(obj, fname)
|
|||
}
|
||||
return stat_new(&st);
|
||||
#else
|
||||
rb_notimplement();
|
||||
return Qnil; /* not reached */
|
||||
return rb_file_s_stat(obj, fname);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
@ -366,7 +365,7 @@ static VALUE
|
|||
rb_file_lstat(obj)
|
||||
VALUE obj;
|
||||
{
|
||||
#if !defined(MSDOS) && !defined(NT)
|
||||
#ifdef HAVE_LSTAT
|
||||
OpenFile *fptr;
|
||||
struct stat st;
|
||||
|
||||
|
@ -378,8 +377,7 @@ rb_file_lstat(obj)
|
|||
}
|
||||
return stat_new(&st);
|
||||
#else
|
||||
rb_notimplement();
|
||||
return Qnil; /* not reached */
|
||||
return rb_io_stat(obj);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
@ -822,15 +820,10 @@ rb_file_s_ftype(obj, fname)
|
|||
{
|
||||
struct stat st;
|
||||
|
||||
#if defined(MSDOS) || defined(NT)
|
||||
if (rb_stat(fname, &st) < 0)
|
||||
rb_sys_fail(RSTRING(fname)->ptr);
|
||||
#else
|
||||
Check_SafeStr(fname);
|
||||
if (lstat(RSTRING(fname)->ptr, &st) == -1) {
|
||||
rb_sys_fail(RSTRING(fname)->ptr);
|
||||
}
|
||||
#endif
|
||||
|
||||
return rb_file_ftype(&st);
|
||||
}
|
||||
|
@ -1119,7 +1112,7 @@ static VALUE
|
|||
rb_file_s_symlink(obj, from, to)
|
||||
VALUE obj, from, to;
|
||||
{
|
||||
#if !defined(MSDOS) && !defined(NT) && !defined(__EMX__) && !defined(riscos)
|
||||
#ifdef HAVE_SYMLINK
|
||||
Check_SafeStr(from);
|
||||
Check_SafeStr(to);
|
||||
|
||||
|
@ -1136,7 +1129,7 @@ static VALUE
|
|||
rb_file_s_readlink(obj, path)
|
||||
VALUE obj, path;
|
||||
{
|
||||
#if !defined(MSDOS) && !defined(NT) && !defined(__EMX__) && !defined(riscos)
|
||||
#ifdef READLINK
|
||||
char buf[MAXPATHLEN];
|
||||
int cc;
|
||||
|
||||
|
|
2
io.c
2
io.c
|
@ -2792,7 +2792,7 @@ rb_io_ctl(io, req, arg, io_p)
|
|||
#ifdef HAVE_FCNTL
|
||||
TRAP_BEG;
|
||||
# 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
|
||||
retval = io_p?ioctl(fd, cmd, narg):fcntl(fd, cmd, narg);
|
||||
# endif
|
||||
|
|
|
@ -12,17 +12,17 @@ module Find
|
|||
while file = path.shift
|
||||
catch(:prune) {
|
||||
yield file
|
||||
if File.directory? file then
|
||||
if File.lstat(file).directory? then
|
||||
d = Dir.open(file)
|
||||
begin
|
||||
for f in d
|
||||
next if f =~ /\A\.\.?\z/
|
||||
if File::ALT_SEPARATOR and file =~ /^([\/\\]|[A-Za-z]:[\/\\]?)$/ then
|
||||
next if f == "." or f == ".."
|
||||
if File::ALT_SEPARATOR and file =~ /^(?:[\/\\]|[A-Za-z]:[\/\\]?)$/ then
|
||||
f = file + f
|
||||
elsif file == "/" then
|
||||
f = "/" + f
|
||||
else
|
||||
f = file + "/" + f
|
||||
f = File.join(file, f)
|
||||
end
|
||||
path.unshift f
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue