mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
.*/.+/.?
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_3@464 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
27e948fd45
commit
039a94478e
7 changed files with 25 additions and 58 deletions
|
|
@ -1,3 +1,7 @@
|
|||
Tue May 11 08:29:28 1999 Yukihiro Matsumoto <matz@netlab.co.jp>
|
||||
|
||||
* regex.c (re_compile_pattern): .?, .+ did not work.
|
||||
|
||||
Mon May 10 00:59:33 1999 Yukihiro Matsumoto <matz@netlab.co.jp>
|
||||
|
||||
* lib/jcode.rb: forgot to squeeze on reverse (complement) case.
|
||||
|
|
|
|||
|
|
@ -256,6 +256,7 @@ SRC
|
|||
end
|
||||
|
||||
def arg_config(config, default=nil)
|
||||
return default if /mswin32/i =~ PLATFORM
|
||||
unless defined? $configure_args
|
||||
$configure_args = {}
|
||||
for arg in ENV["CONFIGURE_ARGS"].split
|
||||
|
|
|
|||
|
|
@ -79,6 +79,8 @@ readline_attempted_completion_function(char *text, int start, int end)
|
|||
int i, matches;
|
||||
|
||||
proc = rb_iv_get(mReadline, COMPLETION_PROC);
|
||||
if (NIL_P(proc))
|
||||
return NULL;
|
||||
rl_attempted_completion_over = 1;
|
||||
case_fold = RTEST(rb_iv_get(mReadline, COMPLETION_CASE_FOLD));
|
||||
ary = rb_funcall(proc, rb_intern("call"), 1, rb_str_new2(text));
|
||||
|
|
|
|||
|
|
@ -518,7 +518,6 @@ thread_write_select(fd)
|
|||
rb_thread_select(fd+1, 0, &fds, 0, 0);
|
||||
}
|
||||
|
||||
#if defined(HAVE_FCNTL)
|
||||
static int
|
||||
ruby_connect(fd, sockaddr, len, socks)
|
||||
int fd;
|
||||
|
|
@ -529,6 +528,7 @@ ruby_connect(fd, sockaddr, len, socks)
|
|||
int status;
|
||||
int mode;
|
||||
|
||||
#if defined(HAVE_FCNTL)
|
||||
mode = fcntl(fd, F_GETFL, 0);
|
||||
|
||||
#ifdef O_NDELAY
|
||||
|
|
@ -541,6 +541,8 @@ ruby_connect(fd, sockaddr, len, socks)
|
|||
#endif
|
||||
#endif
|
||||
fcntl(fd, F_SETFL, mode|NONBLOCKING);
|
||||
#endif /* HAVE_FCNTL */
|
||||
|
||||
for (;;) {
|
||||
#ifdef SOCKS
|
||||
if (socks) {
|
||||
|
|
@ -568,36 +570,14 @@ ruby_connect(fd, sockaddr, len, socks)
|
|||
#endif
|
||||
}
|
||||
}
|
||||
#ifdef HAVE_FCNTL
|
||||
mode &= ~NONBLOCKING;
|
||||
fcntl(fd, F_SETFL, mode);
|
||||
#endif
|
||||
return status;
|
||||
}
|
||||
}
|
||||
|
||||
#else
|
||||
|
||||
#ifdef SOCKS
|
||||
static int
|
||||
ruby_connect(fd, sockaddr, len, socks)
|
||||
int fd;
|
||||
struct sockaddr *sockaddr;
|
||||
int len;
|
||||
int socks;
|
||||
{
|
||||
if (socks) {
|
||||
return Rconnect(fd, sockaddr, len);
|
||||
}
|
||||
else {
|
||||
return connect(fd, sockaddr, len);
|
||||
}
|
||||
}
|
||||
#else
|
||||
|
||||
#define ruby_connect(fd, sockaddr, len, socks) connect(fd, sockaddr, len)
|
||||
|
||||
#endif /* SOCKS */
|
||||
#endif
|
||||
|
||||
static VALUE
|
||||
open_inet(class, h, serv, type)
|
||||
VALUE class, h, serv;
|
||||
|
|
@ -1054,23 +1034,10 @@ udp_connect(sock, host, port)
|
|||
fd = fileno(fptr->f);
|
||||
res0 = udp_addrsetup(fptr, host, port);
|
||||
for (res = res0; res; res = res->ai_next) {
|
||||
retry:
|
||||
if (ruby_connect(fd, res->ai_addr, res->ai_addrlen, 0) >= 0) {
|
||||
freeaddrinfo(res0);
|
||||
return INT2FIX(0);
|
||||
}
|
||||
switch (errno) {
|
||||
case EINTR:
|
||||
rb_thread_schedule();
|
||||
goto retry;
|
||||
|
||||
case EWOULDBLOCK:
|
||||
#if EAGAIN != EWOULDBLOCK
|
||||
case EAGAIN:
|
||||
#endif
|
||||
thread_write_select(fd);
|
||||
goto retry;
|
||||
}
|
||||
}
|
||||
|
||||
freeaddrinfo(res0);
|
||||
|
|
@ -1386,19 +1353,7 @@ sock_connect(sock, addr)
|
|||
|
||||
GetOpenFile(sock, fptr);
|
||||
fd = fileno(fptr->f);
|
||||
retry:
|
||||
if (ruby_connect(fd, (struct sockaddr*)RSTRING(addr)->ptr, RSTRING(addr)->len, 0) < 0) {
|
||||
switch (errno) {
|
||||
case EINTR:
|
||||
rb_thread_schedule();
|
||||
goto retry;
|
||||
case EWOULDBLOCK:
|
||||
#if EAGAIN != EWOULDBLOCK
|
||||
case EAGAIN:
|
||||
#endif
|
||||
thread_write_select(fd);
|
||||
goto retry;
|
||||
}
|
||||
rb_sys_fail("connect(2)");
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -269,6 +269,7 @@ SRC
|
|||
end
|
||||
|
||||
def arg_config(config, default=nil)
|
||||
return default if /mswin32/i =~ PLATFORM
|
||||
unless defined? $configure_args
|
||||
$configure_args = {}
|
||||
for arg in CONFIG["configure_args"].split + ARGV
|
||||
|
|
|
|||
16
regex.c
16
regex.c
|
|
@ -1234,10 +1234,14 @@ re_compile_pattern(pattern, size, bufp)
|
|||
if (!laststart)
|
||||
break;
|
||||
|
||||
if (greedy && *laststart == anychar && b - laststart < 2) {
|
||||
if (greedy && many_times_ok && *laststart == anychar && b - laststart <= 2) {
|
||||
if (b[-1] == stop_paren)
|
||||
b--;
|
||||
*laststart = anychar_repeat;
|
||||
if (zero_times_ok)
|
||||
*laststart = anychar_repeat;
|
||||
else {
|
||||
BUFPUSH(anychar_repeat);
|
||||
}
|
||||
break;
|
||||
}
|
||||
/* Now we know whether or not zero matches is allowed
|
||||
|
|
@ -3375,7 +3379,7 @@ re_match(bufp, string_arg, size, pos, regs)
|
|||
/* End of pattern means we might have succeeded. */
|
||||
if (p == pend) {
|
||||
/* If not end of string, try backtracking. Otherwise done. */
|
||||
if ((bufp->options & RE_OPTION_POSIXMATCH) && d != dend) {
|
||||
if ((bufp->options & RE_OPTION_LONGEST) && d != dend) {
|
||||
if (best_regs_set) /* non-greedy, no need to backtrack */
|
||||
goto restore_best_regs;
|
||||
while (stackp != stackb && stackp[-1] == NON_GREEDY) {
|
||||
|
|
@ -3810,9 +3814,9 @@ re_match(bufp, string_arg, size, pos, regs)
|
|||
/* Jump without taking off any failure points. */
|
||||
case jump:
|
||||
nofinalize:
|
||||
EXTRACT_NUMBER_AND_INCR(mcnt, p);
|
||||
p += mcnt;
|
||||
continue;
|
||||
EXTRACT_NUMBER_AND_INCR(mcnt, p);
|
||||
p += mcnt;
|
||||
continue;
|
||||
|
||||
/* We need this opcode so we can detect where alternatives end
|
||||
in `group_match_null_string_p' et al. */
|
||||
|
|
|
|||
4
regex.h
4
regex.h
|
|
@ -66,9 +66,9 @@
|
|||
/* newline will be included for . and invert charclass matches */
|
||||
#define RE_OPTION_POSIXLINE (RE_OPTION_EXTENDED<<1)
|
||||
/* search for longest match, in accord with POSIX regexp */
|
||||
#define RE_OPTION_POSIXMATCH (RE_OPTION_POSIXLINE<<1)
|
||||
#define RE_OPTION_LONGEST (RE_OPTION_POSIXLINE<<1)
|
||||
|
||||
#define RE_MAY_IGNORECASE (RE_OPTION_POSIXMATCH<<1)
|
||||
#define RE_MAY_IGNORECASE (RE_OPTION_LONGEST<<1)
|
||||
#define RE_OPTIMIZE_ANCHOR (RE_MAY_IGNORECASE<<1)
|
||||
#define RE_OPTIMIZE_EXACTN (RE_OPTIMIZE_ANCHOR<<1)
|
||||
#define RE_OPTIMIZE_NO_BM (RE_OPTIMIZE_EXACTN<<1)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue