* win32/win32.c (rb_w32_stat): check arguments. [ruby-dev:20007]
[ruby-win32:535] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3673 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
fd0fdbe908
commit
6e4a83c0a3
11
ChangeLog
11
ChangeLog
@ -1,14 +1,17 @@
|
|||||||
|
Fri Apr 11 19:00:14 2003 Nobuyoshi Nakada <nobu.nokada@softhome.net>
|
||||||
|
|
||||||
|
* win32/win32.c (rb_w32_stat): check arguments. [ruby-dev:20007]
|
||||||
|
[ruby-win32:535]
|
||||||
|
|
||||||
Fri Apr 11 15:56:08 2003 Nobuyoshi Nakada <nobu.nokada@softhome.net>
|
Fri Apr 11 15:56:08 2003 Nobuyoshi Nakada <nobu.nokada@softhome.net>
|
||||||
|
|
||||||
* sample/test.rb: NaN comparison test.
|
|
||||||
|
|
||||||
Fri Apr 11 15:37:43 2003 Nobuyoshi Nakada <nobu.nokada@softhome.net>
|
|
||||||
|
|
||||||
* numeric.c (coerce_rescue): prevent inspected String from GC.
|
* numeric.c (coerce_rescue): prevent inspected String from GC.
|
||||||
|
|
||||||
* numeric.c (flo_eq, rb_dbl_cmp, flo_gt, flo_ge, flo_lt, flo_le,
|
* numeric.c (flo_eq, rb_dbl_cmp, flo_gt, flo_ge, flo_lt, flo_le,
|
||||||
flo_eql): correct NaN comparison. (ruby-bugs:PR#744)
|
flo_eql): correct NaN comparison. (ruby-bugs:PR#744)
|
||||||
|
|
||||||
|
* sample/test.rb: NaN comparison test.
|
||||||
|
|
||||||
Fri Apr 11 14:48:47 2003 Yukihiro Matsumoto <matz@ruby-lang.org>
|
Fri Apr 11 14:48:47 2003 Yukihiro Matsumoto <matz@ruby-lang.org>
|
||||||
|
|
||||||
* file.c (rb_stat): dereference using StringValuePtr().
|
* file.c (rb_stat): dereference using StringValuePtr().
|
||||||
|
@ -2724,12 +2724,15 @@ int
|
|||||||
rb_w32_stat(const char *path, struct stat *st)
|
rb_w32_stat(const char *path, struct stat *st)
|
||||||
{
|
{
|
||||||
const char *p;
|
const char *p;
|
||||||
char *buf1 = ALLOCA_N(char, strlen(path) + 2);
|
char *buf1, *buf2, *s;
|
||||||
char *buf2 = ALLOCA_N(char, MAXPATHLEN);
|
|
||||||
char *s;
|
|
||||||
int len;
|
int len;
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
|
if (!path || !st) {
|
||||||
|
errno = EFAULT;
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
buf1 = ALLOCA_N(char, strlen(path) + 2);
|
||||||
for (p = path, s = buf1; *p; p++, s++) {
|
for (p = path, s = buf1; *p; p++, s++) {
|
||||||
if (*p == '/')
|
if (*p == '/')
|
||||||
*s = '\\';
|
*s = '\\';
|
||||||
@ -2749,6 +2752,7 @@ rb_w32_stat(const char *path, struct stat *st)
|
|||||||
strcat(buf1, "\\");
|
strcat(buf1, "\\");
|
||||||
} else if (*p == '\\' || *p == ':')
|
} else if (*p == '\\' || *p == ':')
|
||||||
strcat(buf1, ".");
|
strcat(buf1, ".");
|
||||||
|
buf2 = ALLOCA_N(char, MAXPATHLEN);
|
||||||
if (_fullpath(buf2, buf1, MAXPATHLEN)) {
|
if (_fullpath(buf2, buf1, MAXPATHLEN)) {
|
||||||
ret = stat(buf2, st);
|
ret = stat(buf2, st);
|
||||||
if (ret == 0) {
|
if (ret == 0) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user