зеркало из https://github.com/github/ruby.git
* parse.y (tokadd_string): ignore backslashed spaces in %w.
* enum.c (enum_find): do not use rb_eval_cmd(); should not accept a string for if_none. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2679 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
Родитель
2b98e10419
Коммит
5e6634ce67
|
@ -1,3 +1,12 @@
|
|||
Thu Aug 1 17:47:15 2002 Tachino Nobuhiro <tachino@jp.fujitsu.com>
|
||||
|
||||
* parse.y (tokadd_string): ignore backslashed spaces in %w.
|
||||
|
||||
Thu Aug 1 14:14:15 2002 Yukihiro Matsumoto <matz@ruby-lang.org>
|
||||
|
||||
* enum.c (enum_find): do not use rb_eval_cmd(); should not accept
|
||||
a string for if_none.
|
||||
|
||||
Wed Jul 31 14:11:43 2002 Yukihiro Matsumoto <matz@ruby-lang.org>
|
||||
|
||||
* eval.c (rb_undef): undef should be done for klass, not ruby_class.
|
||||
|
|
|
@ -308,7 +308,7 @@ AC_CHECK_FUNCS(ftello)
|
|||
AC_REPLACE_FUNCS(dup2 memmove mkdir strcasecmp strncasecmp strerror strftime\
|
||||
strchr strstr strtoul crypt flock vsnprintf\
|
||||
isinf isnan finite hypot acosh)
|
||||
AC_CHECK_FUNCS(fmod killpg drand48 random wait4 waitpid syscall chroot fsync\
|
||||
AC_CHECK_FUNCS(fmod killpg wait4 waitpid syscall chroot fsync\
|
||||
truncate chsize times utimes fcntl lockf lstat symlink readlink\
|
||||
setitimer setruid seteuid setreuid setresuid setproctitle\
|
||||
setrgid setegid setregid setresgid pause lchown lchmod\
|
||||
|
|
2
enum.c
2
enum.c
|
@ -90,7 +90,7 @@ enum_find(argc, argv, obj)
|
|||
}
|
||||
rb_gc_force_recycle((VALUE)memo);
|
||||
if (!NIL_P(if_none)) {
|
||||
rb_eval_cmd(if_none, rb_ary_new2(0), 0);
|
||||
return rb_funcall(if_none, rb_intern("call"), 0, 0);
|
||||
}
|
||||
return Qnil;
|
||||
}
|
||||
|
|
|
@ -434,6 +434,7 @@ s_recvfrom(sock, argc, argv, from)
|
|||
char buf[1024];
|
||||
socklen_t alen = sizeof buf;
|
||||
VALUE len, flg;
|
||||
long slen;
|
||||
int fd, flags;
|
||||
|
||||
rb_scan_args(argc, argv, "11", &len, &flg);
|
||||
|
@ -447,16 +448,16 @@ s_recvfrom(sock, argc, argv, from)
|
|||
}
|
||||
fd = fileno(fptr->f);
|
||||
|
||||
str = rb_tainted_str_new(0, NUM2INT(len));
|
||||
slen = NUM2INT(len);
|
||||
str = rb_tainted_str_new(0, slen);
|
||||
|
||||
retry:
|
||||
rb_thread_wait_fd(fd);
|
||||
TRAP_BEG;
|
||||
RSTRING(str)->len = recvfrom(fd, RSTRING(str)->ptr, RSTRING(str)->len, flags,
|
||||
(struct sockaddr*)buf, &alen);
|
||||
slen = recvfrom(fd, RSTRING(str)->ptr, slen, flags, (struct sockaddr*)buf, &alen);
|
||||
TRAP_END;
|
||||
|
||||
if (RSTRING(str)->len < 0) {
|
||||
if (slen < 0) {
|
||||
switch (errno) {
|
||||
case EINTR:
|
||||
rb_thread_schedule();
|
||||
|
@ -464,6 +465,10 @@ s_recvfrom(sock, argc, argv, from)
|
|||
}
|
||||
rb_sys_fail("recvfrom(2)");
|
||||
}
|
||||
if (slen < RSTRING(str)->len) {
|
||||
RSTRING(str)->len = slen;
|
||||
RSTRING(str)->ptr[slen] = '\0';
|
||||
}
|
||||
rb_obj_taint(str);
|
||||
switch (from) {
|
||||
case RECV_RECV:
|
||||
|
|
3
parse.y
3
parse.y
|
@ -2836,6 +2836,9 @@ tokadd_string(func, term, paren)
|
|||
if (func & STR_FUNC_ESCAPE) tokadd('\\');
|
||||
c = read_escape();
|
||||
}
|
||||
else if ((func & STR_FUNC_QWORDS) && ISSPACE(c)) {
|
||||
/* ignore backslashed spaces in %w */
|
||||
}
|
||||
else if (c != term && !(paren && c == paren)) {
|
||||
tokadd('\\');
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче