mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* ruby.c (proc_options): unexpected SecurityError happens when -T4.
* regex.c (re_compile_pattern): * \1 .. \9 should be backreferences always. * regex.c (re_match): backreferences corresponding to unclosed/unmatched parentheses should fail always. * string.c (rb_str_cat): use rb_str_buf_cat() if possible. [new] * string.c (rb_str_append): ditto. * string.c (rb_str_buf_cat): remove unnecessary check (type, taint, modify) to gain performance. * string.c (rb_str_buf_append): ditto. * string.c (rb_str_buf_finish): removed. * string.c (rb_str_buf_new): buffering string function. [new] * string.c (rb_str_buf_append): ditto. * string.c (rb_str_buf_cat): ditto. * string.c (rb_str_buf_finish): ditto. * time.c (make_time_t): local time adjustment revised. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1475 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
032825472b
commit
4cd1cd7201
8 changed files with 1415 additions and 29 deletions
|
@ -665,6 +665,10 @@ module TkPackage
|
||||||
include TkCore
|
include TkCore
|
||||||
extend TkPackage
|
extend TkPackage
|
||||||
|
|
||||||
|
def add_path(path)
|
||||||
|
Tk::AUTO_PATH.value = Tk::AUTO_PATH.to_a << path
|
||||||
|
end
|
||||||
|
|
||||||
def forget(package)
|
def forget(package)
|
||||||
tk_call('package', 'forget', package)
|
tk_call('package', 'forget', package)
|
||||||
nil
|
nil
|
||||||
|
@ -726,9 +730,6 @@ module Tk
|
||||||
TK_LIBRARY = INTERP._invoke("set", "tk_library")
|
TK_LIBRARY = INTERP._invoke("set", "tk_library")
|
||||||
LIBRARY = INTERP._invoke("info", "library")
|
LIBRARY = INTERP._invoke("info", "library")
|
||||||
|
|
||||||
TCL_PACKAGE_PATH = INTERP._invoke("set", "tcl_pkgPath")
|
|
||||||
AUTO_PATH = tk_split_simplelist(INTERP._invoke("set", "auto_path"))
|
|
||||||
|
|
||||||
PLATFORM = Hash[*tk_split_simplelist(INTERP._eval('array get tcl_platform'))]
|
PLATFORM = Hash[*tk_split_simplelist(INTERP._eval('array get tcl_platform'))]
|
||||||
|
|
||||||
JAPANIZED_TK = (INTERP._invoke("info", "commands", "kanji") != "")
|
JAPANIZED_TK = (INTERP._invoke("info", "commands", "kanji") != "")
|
||||||
|
@ -1379,6 +1380,21 @@ class TkVarAccess<TkVariable
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
module Tk
|
||||||
|
begin
|
||||||
|
auto_path = INTERP._invoke('set', 'auto_path')
|
||||||
|
rescue
|
||||||
|
begin
|
||||||
|
auto_path = INTERP._invoke('set', 'env(TCLLIBPATH)')
|
||||||
|
rescue
|
||||||
|
auto_path = Tk::LIBRARY
|
||||||
|
end
|
||||||
|
end
|
||||||
|
AUTO_PATH = TkVarAccess.new('auto_path', auto_path)
|
||||||
|
|
||||||
|
TCL_PACKAGE_PATH = TkVarAccess.new('tcl_pkgPath')
|
||||||
|
end
|
||||||
|
|
||||||
module TkSelection
|
module TkSelection
|
||||||
include Tk
|
include Tk
|
||||||
extend Tk
|
extend Tk
|
||||||
|
|
|
@ -45,9 +45,11 @@ ping.rb checks whether host is up, using TCP echo.
|
||||||
profile.rb ruby profiler
|
profile.rb ruby profiler
|
||||||
pstore.rb persistent object strage using marshal
|
pstore.rb persistent object strage using marshal
|
||||||
rational.rb rational number support
|
rational.rb rational number support
|
||||||
readbytes.rb defines IO#readbytes
|
readbytes.rb define IO#readbytes
|
||||||
|
resolv.rb DNS resolver in Ruby
|
||||||
|
resolv-replace.rb replace Socket DNS by resolve.rb
|
||||||
shell.rb runs commands and does pipeline operations like shell
|
shell.rb runs commands and does pipeline operations like shell
|
||||||
shellwords.rb splits string into words like shell
|
shellwords.rb split into words like shell
|
||||||
singleton.rb singleton design pattern library
|
singleton.rb singleton design pattern library
|
||||||
sync.rb 2 phase lock
|
sync.rb 2 phase lock
|
||||||
telnet.rb obsolete - use net/telnet
|
telnet.rb obsolete - use net/telnet
|
||||||
|
|
|
@ -282,8 +282,7 @@ SRC
|
||||||
print "no\n"
|
print "no\n"
|
||||||
return false
|
return false
|
||||||
end
|
end
|
||||||
header.tr!("a-z./\055", "A-Z___")
|
$defs.push(format("-DHAVE_%s", header.tr("a-z./\055", "A-Z___")))
|
||||||
$defs.push(format("-DHAVE_%s", header))
|
|
||||||
print "yes\n"
|
print "yes\n"
|
||||||
return true
|
return true
|
||||||
end
|
end
|
||||||
|
|
41
lib/resolv-replace.rb
Normal file
41
lib/resolv-replace.rb
Normal file
|
@ -0,0 +1,41 @@
|
||||||
|
require 'resolv'
|
||||||
|
|
||||||
|
class BasicSocket
|
||||||
|
alias original_resolv_send send
|
||||||
|
def send(mesg, flags, *rest)
|
||||||
|
rest[0] = Resolv.getaddress(rest[0]).to_s if 0 < rest.length
|
||||||
|
original_resolv_send(mesg, flags, *rest)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
class << IPSocket
|
||||||
|
alias original_resolv_getaddress getaddress
|
||||||
|
def getaddress(host)
|
||||||
|
return Resolv.getaddress(host).to_s
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
class << TCPSocket
|
||||||
|
alias original_resolv_new new
|
||||||
|
def new(host, service)
|
||||||
|
original_resolv_new(Resolv.getaddress(host).to_s, service)
|
||||||
|
end
|
||||||
|
|
||||||
|
alias original_resolv_open open
|
||||||
|
def open(host, service)
|
||||||
|
original_resolv_open(Resolv.getaddress(host).to_s, service)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
class UDPSocket
|
||||||
|
alias original_resolv_connect connect
|
||||||
|
def connect(host, port)
|
||||||
|
original_resolv_connect(Resolv.getaddress(host).to_s, port)
|
||||||
|
end
|
||||||
|
|
||||||
|
alias original_resolv_send send
|
||||||
|
def send(mesg, flags, *rest)
|
||||||
|
rest[0] = Resolv.getaddress(rest[0]).to_s if 0 < rest.length
|
||||||
|
original_resolv_send(mesg, flags, *rest)
|
||||||
|
end
|
||||||
|
end
|
1346
lib/resolv.rb
Normal file
1346
lib/resolv.rb
Normal file
File diff suppressed because it is too large
Load diff
|
@ -255,7 +255,7 @@ class Shell
|
||||||
return unless yorn
|
return unless yorn
|
||||||
|
|
||||||
_head = true
|
_head = true
|
||||||
print *opts.collect{|mes|
|
print opts.collect{|mes|
|
||||||
mes = mes.dup
|
mes = mes.dup
|
||||||
yield mes if iterator?
|
yield mes if iterator?
|
||||||
if _head
|
if _head
|
||||||
|
|
|
@ -672,7 +672,9 @@ An end of a defun is found by moving forward from the beginning of one."
|
||||||
("\\(#\\)[{$@]" 1 (1 . nil))
|
("\\(#\\)[{$@]" 1 (1 . nil))
|
||||||
("\\(/\\)\\([^/\n]\\|\\/\\)*\\(/\\)"
|
("\\(/\\)\\([^/\n]\\|\\/\\)*\\(/\\)"
|
||||||
(1 (7 . ?'))
|
(1 (7 . ?'))
|
||||||
(3 (7 . ?')))))
|
(3 (7 . ?')))
|
||||||
|
("^\\(=\\)begin\\(\\s \\|$\\)" 1 (7 . nil))
|
||||||
|
("^\\(=\\)end\\(\\s \\|$\\)" 1 (7 . nil))))
|
||||||
(make-local-variable 'font-lock-defaults)
|
(make-local-variable 'font-lock-defaults)
|
||||||
(setq font-lock-defaults '((ruby-font-lock-keywords) nil nil))
|
(setq font-lock-defaults '((ruby-font-lock-keywords) nil nil))
|
||||||
(setq font-lock-keywords ruby-font-lock-keywords)))
|
(setq font-lock-keywords ruby-font-lock-keywords)))
|
||||||
|
|
20
win32/dir.h
20
win32/dir.h
|
@ -1,20 +0,0 @@
|
||||||
struct direct
|
|
||||||
{
|
|
||||||
long d_namlen;
|
|
||||||
ino_t d_ino;
|
|
||||||
char d_name[256];
|
|
||||||
};
|
|
||||||
typedef struct {
|
|
||||||
char *start;
|
|
||||||
char *curr;
|
|
||||||
long size;
|
|
||||||
long nfiles;
|
|
||||||
struct direct dirstr;
|
|
||||||
} DIR;
|
|
||||||
|
|
||||||
DIR* opendir(const char*);
|
|
||||||
struct direct* readdir(DIR *);
|
|
||||||
long telldir(DIR *);
|
|
||||||
void seekdir(DIR *, long);
|
|
||||||
void rewinddir(DIR *);
|
|
||||||
void closedir(DIR *);
|
|
Loading…
Add table
Add a link
Reference in a new issue