diff options
author | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 1999-05-18 06:06:17 +0000 |
---|---|---|
committer | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 1999-05-18 06:06:17 +0000 |
commit | df5a9e28234919326128db50c13467d971871cbf (patch) | |
tree | 79a6e234266f7a54fc3c657a7752fe74943748db | |
parent | c59869494a1a299cad47676e626cfc918c92364e (diff) |
mbc bug in regex
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_3@471 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r-- | ChangeLog | 10 | ||||
-rw-r--r-- | dln.c | 25 | ||||
-rw-r--r-- | ext/extmk.rb.nt | 3 | ||||
-rw-r--r-- | io.c | 2 | ||||
-rw-r--r-- | regex.c | 6 | ||||
-rw-r--r-- | ruby.c | 2 |
6 files changed, 35 insertions, 13 deletions
@@ -1,3 +1,11 @@ +Tue May 18 15:25:45 1999 Yukihiro Matsumoto <matz@netlab.co.jp> + + * regex.c (re_search): a bug in range adjustment. + +Tue May 18 11:35:59 1999 WATANABE Hirofumi <watanabe@ase.ptg.sony.co.jp> + + * dln.c (conv_to_posix_path): path_len argument added. + Mon May 17 12:26:31 1999 Yukihiro Matsumoto <matz@netlab.co.jp> * numeric.c (fix_rev): should treat Fixnum as signed long. @@ -287,7 +295,7 @@ Fri Apr 16 15:09:20 1999 Yukihiro Matsumoto <matz@netlab.co.jp> * config.guess: avoid 'linux-gnu' for alpha-unknown-linux. - Thu Apr 15 23:46:20 1999 WATANABE Hirofumi <watanabe@ase.ptg.sony.co.jp> +Thu Apr 15 23:46:20 1999 WATANABE Hirofumi <watanabe@ase.ptg.sony.co.jp> * ruby.c (rubylib_mangle): mangle path by RUBYLIB_PREFIX. @@ -78,7 +78,7 @@ int eaccess(); #endif #ifndef FUNCNAME_PATTERN -# if defined(__hp9000s300) || (defined(__NetBSD__) && (!defined(__alpha__) && !defined(__mips__))) || defined(__BORLANDC__) || (defined(__FreeBSD__) && __FreeBSD__ < 3) || defined(NeXT) || defined(__WATCOMC__) +# if defined(__hp9000s300) || (defined(__NetBSD__) && (!defined(__alpha__) && !defined(__mips__))) || defined(__BORLANDC__) || (defined(__FreeBSD__) && __FreeBSD__ < 3) || defined(NeXT) || defined(__WATCOMC__) || defined(__APPLE__) # define FUNCNAME_PATTERN "_Init_%.200s" # else # define FUNCNAME_PATTERN "Init_%.200s" @@ -1095,6 +1095,10 @@ dln_sym(name) #include <mach-o/dyld.h> #endif #endif +#ifdef __APPLE__ +#include <mach-o/dyld.h> +#endif + #ifdef _WIN32 #include <windows.h> @@ -1356,7 +1360,7 @@ dln_load(file) } #endif /* _AIX */ -#ifdef NeXT +#if defined(NeXT) || defined(__APPLE__) #define DLN_DEFINED /*---------------------------------------------------- By SHIROYAMA Takayuki Psi@fortune.nest.or.jp @@ -1366,7 +1370,8 @@ dln_load(file) Mi hisho@tasihara.nest.or.jp, and... Miss ARAI Akino(^^;) ----------------------------------------------------*/ -#if NS_TARGET_MAJOR < 4 /* NeXTSTEP rld functions */ +#if defined(NeXT) && ( NS_TARGET_MAJOR < 4 )/* NeXTSTEP rld functions */ + { unsigned long init_address; char *object_files[2] = {NULL, NULL}; @@ -1572,9 +1577,10 @@ dln_find_file(fname, path) #if defined(__CYGWIN32__) const char * -conv_to_posix_path(win32, posix) +conv_to_posix_path(win32, posix, len) char *win32; char *posix; + int len; { char *first = win32; char *p = win32; @@ -1589,7 +1595,10 @@ conv_to_posix_path(win32, posix) first = p + 1; *p = ';'; } - cygwin32_conv_to_posix_path(first, posix); + if (len < strlen(first)) + fprintf(stderr, "PATH length too long: %s\n", first); + else + strcpy(posix, first); return dst; } #endif @@ -1612,8 +1621,10 @@ dln_find_1(fname, path, exe_flag) #endif #if defined(__CYGWIN32__) - char rubypath[MAXPATHLEN]; - conv_to_posix_path(path, rubypath); + int pathlen = 2 * strlen(path); + int rubypathlen = pathlen > MAXPATHLEN ? pathlen : MAXPATHLEN; + char *rubypath = alloca(rubypathlen); + conv_to_posix_path(path, rubypath, rubypathlen); path = rubypath; #endif if (fname[0] == '/') return fname; diff --git a/ext/extmk.rb.nt b/ext/extmk.rb.nt index 436cac295f..509bca398d 100644 --- a/ext/extmk.rb.nt +++ b/ext/extmk.rb.nt @@ -322,7 +322,7 @@ VPATH = . CC = cl -CFLAGS = %s -I../.. -I../../missing -I../../win32 -I. -O -DNT %s #{CFLAGS} #$CFLAGS %s +CFLAGS = %s -I../.. -I../../missing -I../../win32 -I. -O -DNT %s #{CFLAGS} #{$CFLAGS} %s RUBYLIB = ../../ruby.lib DLDFLAGS = /DLL @@ -436,6 +436,7 @@ def extmake(target) return if $nodynamic and not $static + $objs = nil $LOCAL_LIBS = "" # to be assigned in extconf.rb $CFLAGS = "" $LDFLAGS = "" @@ -2163,7 +2163,7 @@ next_argv() } file = prep_stdio(fr, FMODE_READABLE, rb_cFile); } - rb_io_binmode(file); + if (binmode) rb_io_binmode(file); } else { init_p = 0; @@ -2968,9 +2968,11 @@ re_search(bufp, string, size, startpos, range, regs) while (range > 0) { c = *p++; if (ismbchar(c)) { - int len = mbclen(c) - 1; + int len; + if (fastmap[c]) break; + len = mbclen(c) - 1; while (len--) { c = *p++; range--; @@ -2981,8 +2983,8 @@ re_search(bufp, string, size, startpos, range, regs) else { if (fastmap[MAY_TRANSLATE() ? translate[c] : c]) break; - range--; } + range--; } startpos_adjust: startpos += irange - range; @@ -191,7 +191,7 @@ addpath(path) #if defined(__CYGWIN32__) { char rubylib[FILENAME_MAX]; - conv_to_posix_path(path, rubylib); + conv_to_posix_path(path, rubylib, FILENAME_MAX); path = rubylib; } #endif |