зеркало из https://github.com/github/ruby.git
* time.c: prototype; time_free() to avoid VC++ warnings.
* win32/win32.c (rb_w32_stat): remove S_IWGRP and S_IWOTH bits from st_mode. * win32/win32.h (S_I*): define if not defined. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2822 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
Родитель
b8ff4a843e
Коммит
d1a4bf7d3a
|
@ -1,3 +1,12 @@
|
|||
Sun Sep 8 19:02:28 2002 NAKAMURA Usaku <usa@ruby-lang.org>
|
||||
|
||||
* time.c: prototype; time_free() to avoid VC++ warnings.
|
||||
|
||||
* win32/win32.c (rb_w32_stat): remove S_IWGRP and S_IWOTH bits from
|
||||
st_mode.
|
||||
|
||||
* win32/win32.h (S_I*): define if not defined.
|
||||
|
||||
Sun Sep 8 14:38:31 2002 WATANABE Hirofumi <eban@ruby-lang.org>
|
||||
|
||||
* configure.in: modify program_prefix only if specified
|
||||
|
|
2
time.c
2
time.c
|
@ -43,6 +43,8 @@ struct time_object {
|
|||
#define GetTimeval(obj, tobj) \
|
||||
Data_Get_Struct(obj, struct time_object, tobj)
|
||||
|
||||
static void time_free _((struct time_object *));
|
||||
|
||||
static void
|
||||
time_free(tobj)
|
||||
struct time_object *tobj;
|
||||
|
|
|
@ -2506,6 +2506,7 @@ rb_w32_stat(const char *path, struct stat *st)
|
|||
char *buf2 = ALLOCA_N(char, MAXPATHLEN);
|
||||
char *s;
|
||||
int len;
|
||||
int ret;
|
||||
|
||||
for (p = path, s = buf1; *p; p++, s++) {
|
||||
if (*p == '/')
|
||||
|
@ -2521,8 +2522,13 @@ rb_w32_stat(const char *path, struct stat *st)
|
|||
strcat(buf1, "\\");
|
||||
} else if (*p == '\\' || *p == ':')
|
||||
strcat(buf1, ".");
|
||||
if (_fullpath(buf2, buf1, MAXPATHLEN))
|
||||
return stat(buf2, st);
|
||||
if (_fullpath(buf2, buf1, MAXPATHLEN)) {
|
||||
ret = stat(buf2, st);
|
||||
if (ret == 0) {
|
||||
st->st_mode &= ~(S_IWGRP | S_IWOTH);
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
else
|
||||
return -1;
|
||||
}
|
||||
|
|
|
@ -240,6 +240,36 @@ extern int isnan(double);
|
|||
#define S_ISREG(m) (((unsigned short)(m) & S_IFMT) == S_IFREG)
|
||||
#endif
|
||||
|
||||
#ifndef S_IRUSR
|
||||
#define S_IRUSR 0400
|
||||
#endif
|
||||
#ifndef S_IRGRP
|
||||
#define S_IRGRP 0040
|
||||
#endif
|
||||
#ifndef S_IROTH
|
||||
#define S_IROTH 0004
|
||||
#endif
|
||||
|
||||
#ifndef S_IWUSR
|
||||
#define S_IWUSR 0200
|
||||
#endif
|
||||
#ifndef S_IWGRP
|
||||
#define S_IWGRP 0020
|
||||
#endif
|
||||
#ifndef S_IWOTH
|
||||
#define S_IWOTH 0002
|
||||
#endif
|
||||
|
||||
#ifndef S_IXUSR
|
||||
#define S_IXUSR 0100
|
||||
#endif
|
||||
#ifndef S_IXGRP
|
||||
#define S_IXGRP 0010
|
||||
#endif
|
||||
#ifndef S_IXOTH
|
||||
#define S_IXOTH 0001
|
||||
#endif
|
||||
|
||||
//
|
||||
// define this so we can do inplace editing
|
||||
//
|
||||
|
|
Загрузка…
Ссылка в новой задаче