Skip to content

Commit

Permalink
matz
Browse files Browse the repository at this point in the history
git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@985 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
  • Loading branch information
matz committed Oct 2, 2000
1 parent 46b28a7 commit 846ce3e
Show file tree
Hide file tree
Showing 12 changed files with 59 additions and 40 deletions.
13 changes: 13 additions & 0 deletions ChangeLog
@@ -1,7 +1,20 @@
Mon Oct 2 05:28:58 2000 akira yamada <akira@ruby-lang.org>

* string.c (trnext): minus at the end of pattern.

Sun Oct 1 00:43:34 2000 WATANABE Hirofumi <eban@ruby-lang.org>

* configure.in: exp-name was wrong on cygwin and mingw32.

Thu Sep 28 14:57:09 2000 Yukihiro Matsumoto <matz@ruby-lang.org>

* regex.c (re_compile_pattern): should try must_string calculation
every time.

Tue Sep 19 23:47:44 2000 SHIROYAMA Takayuki <psi@fortune.nest.or.jp>

* configure.in, config.guess, config.sub: MacOS X support.

Wed Sep 27 18:40:05 2000 Yukihiro Matsumoto <matz@ruby-lang.org>

* stable version 1.6.1 released.
Expand Down
2 changes: 1 addition & 1 deletion config.guess
Expand Up @@ -970,7 +970,7 @@ EOF
echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE}
exit 0 ;;
*:Darwin:*:*)
echo ${UNAME_MACHINE}-apple-darwin${UNAME_RELEASE}
echo `uname -p`-apple-darwin${UNAME_RELEASE}
exit 0 ;;
esac

Expand Down
16 changes: 9 additions & 7 deletions configure.in
Expand Up @@ -57,9 +57,11 @@ AC_ARG_ENABLE(fat-binary,
# to ensure AC_HEADER_SYS_WAIT works
AC_DEFINE(_POSIX_SOURCE)
;;
darwin*)
macos*|darwin*)
echo -n "MacOS X (Darwin): "
TARGET_ARCHS="ppc"
if test "$TARGET_ARCHS" = "" ; then
TARGET_ARCHS="ppc i386"
fi
;;
esac
# /usr/lib/arch_tool -archify_list $TARGET_ARCHS
Expand Down Expand Up @@ -164,7 +166,7 @@ case "$target_os" in
nextstep*) ;;
openstep*) ;;
rhapsody*) ;;
darwin*) ;;
darwin*) LIBS="-lobjc $LIBS";;
human*) ac_cv_func_getpgrp_void=yes;;
beos*) ;;
cygwin*) rb_cv_have_daylight=no;;
Expand Down Expand Up @@ -731,7 +733,7 @@ LIBRUBYARG='$(LIBRUBY_A)'
SOLIBS=

case "$target_os" in
cygwin*|mingw*|beos*|openstep*|nextstep*|rhapsody*|os2_emx*)
cygwin*|mingw*|beos*|openstep*|nextstep*|rhapsody*|darwin*|os2_emx*)
DLDLIBS=""
;;
*)
Expand Down Expand Up @@ -900,7 +902,7 @@ test "$program_suffix" != NONE &&

RUBY_INSTALL_NAME="${ri_prefix}ruby${ri_suffix}"
case "$target_os" in
cygwin*|mingw*|*djgpp*)
cygwin*|mingw*|*djgpp*|os2_emx*)
RUBY_LIB_PREFIX="/lib/ruby"
;;
*)
Expand All @@ -913,9 +915,9 @@ AC_ARG_WITH(sitedir,
[--with-sitedir=DIR site libraries in DIR [PREFIX/lib/ruby/site_ruby]],
[sitedir=$withval],
[sitedir='${prefix}/lib/ruby/site_ruby'])
SITE_DIR="`eval "echo ${sitedir}"`"
SITE_DIR="`eval \"echo ${sitedir}\"`"
case "$target_os" in
cygwin*|mingw*|*djgpp*)
cygwin*|mingw*|*djgpp*|os2_emx*)
RUBY_SITE_LIB_PATH="`expr "$SITE_DIR" : "$prefix\(/.*\)"`" ||
RUBY_SITE_LIB_PATH="$SITE_DIR";;
*)
Expand Down
35 changes: 19 additions & 16 deletions lib/find.rb
Expand Up @@ -10,27 +10,30 @@
module Find
def find(*path)
while file = path.shift
catch(:prune) {
catch(:prune) do
yield file
if File.lstat(file).directory? then
d = Dir.open(file)
begin
for f in d
next if f == "." or f == ".."
if File::ALT_SEPARATOR and file =~ /^(?:[\/\\]|[A-Za-z]:[\/\\]?)$/ then
f = file + f
elsif file == "/" then
f = "/" + f
else
f = File.join(file, f)
begin
if File.lstat(file).directory? then
d = Dir.open(file)
begin
for f in d
next if f == "." or f == ".."
if File::ALT_SEPARATOR and file =~ /^(?:[\/\\]|[A-Za-z]:[\/\\]?)$/ then
f = file + f
elsif file == "/" then
f = "/" + f
else
f = File.join(file, f)
end
path.unshift f
end
path.unshift f
ensure
d.close
end
ensure
d.close
end
rescue Errno::ENOENT
end
}
end
end
end

Expand Down
4 changes: 3 additions & 1 deletion lib/mkmf.rb
Expand Up @@ -343,7 +343,7 @@ def create_makefile(target)
print "creating Makefile\n"
rm_f "conftest*"
STDOUT.flush
if target.rindex(%r!/!)
if target.rindex(%r!/!) #/
target = $'
target_prefix = "/"+$`
else
Expand Down Expand Up @@ -529,3 +529,5 @@ def create_makefile(target)

$CFLAGS = idir || ""
$LDFLAGS = ldir || ""

$hdrdir.gsub!('/', '\\') if RUBY_PLATFORM =~ /mswin32/
5 changes: 5 additions & 0 deletions main.c
Expand Up @@ -28,6 +28,11 @@ int _CRT_glob = 0;
#include <console.h>
#endif

/* to link startup code with ObjC support */
#if defined(__APPLE__) && defined(__MACH__)
static void objcdummyfunction( void ) { objc_msgSend(); }
#endif

int
main(argc, argv, envp)
int argc;
Expand Down
4 changes: 2 additions & 2 deletions misc/ruby-mode.el
Expand Up @@ -670,9 +670,9 @@ An end of a defun is found by moving forward from the beginning of one."
(setq font-lock-syntactic-keywords
'(("\\$\\([#\"'`$\\]\\)" 1 (1 . nil))
("\\(#\\)[{$@]" 1 (1 . nil))
("\\(/\\).*\\(/\\)"
("\\(/\\)\\([^/]\\|\\\\/\\)*\\(/\\)"
(1 (7 . ?'))
(2 (7 . ?')))))
(3 (7 . ?')))))
(make-local-variable 'font-lock-defaults)
(setq font-lock-defaults '((ruby-font-lock-keywords) nil nil))
(setq font-lock-keywords ruby-font-lock-keywords)))
Expand Down
2 changes: 1 addition & 1 deletion regex.c
Expand Up @@ -2395,7 +2395,7 @@ re_compile_pattern(pattern, size, bufp)
bufp->must = laststart+1;
}
}
else {
if (!bufp->must) {
bufp->must = calculate_must_string(bufp->buffer, b);
}
if (current_mbctype == MBCTYPE_SJIS) bufp->options |= RE_OPTIMIZE_NO_BM;
Expand Down
4 changes: 3 additions & 1 deletion ruby.c
Expand Up @@ -205,7 +205,7 @@ ruby_incpush(path)
void
ruby_init_loadpath()
{
#if defined(_WIN32) || defined(DJGPP)
#if defined(_WIN32) || defined(DJGPP) || defined(__EMX__)
char libpath[FILENAME_MAX+1];
char *p;
size_t rest;
Expand All @@ -214,6 +214,8 @@ ruby_init_loadpath()
#elif defined(DJGPP)
extern char *__dos_argv0;
strncpy(libpath, __dos_argv0, FILENAME_MAX);
#elif defined(__EMX__)
_execname(libpath, FILENAME_MAX);
#endif
p = strrchr(libpath, '\\');
if (p) {
Expand Down
2 changes: 1 addition & 1 deletion sample/occur2.rb
Expand Up @@ -5,7 +5,7 @@
for word in $_.split(/\W+/)
begin
freq[word] = freq[word] + 1
rescue
rescue NameError
freq[word] = 1
end
end
Expand Down
2 changes: 1 addition & 1 deletion string.c
Expand Up @@ -1797,7 +1797,7 @@ trnext(t)
if (!t->gen) {
if (t->p == t->pend) return -1;
t->now = *(USTR)t->p++;
if (t->p < t->pend && *t->p == '-') {
if (t->p < t->pend - 1 && *t->p == '-') {
t->p++;
if (t->p < t->pend) {
if (t->now > *(USTR)t->p) {
Expand Down
10 changes: 1 addition & 9 deletions win32/win32.c
Expand Up @@ -1904,7 +1904,6 @@ myselect (int nfds, fd_set *rd, fd_set *wr, fd_set *ex,
long r;
fd_set file_rd;
fd_set file_wr;
fd_set trap;
int file_nfds;
int trap_immediate = rb_trap_immediate;

Expand All @@ -1925,16 +1924,9 @@ myselect (int nfds, fd_set *rd, fd_set *wr, fd_set *ex,
if (wr) *wr = file_wr;
return file_nfds;
}
if (ex)
trap = *ex;
else
trap.fd_count = 0;
if (trap.fd_count < FD_SETSIZE)
trap.fd_array[trap.fd_count++] = rb_InterruptEvent;
// else unable to catch interrupt.
if (trap_immediate)
TRAP_END;
if ((r = select (nfds, rd, wr, &trap, timeout)) == SOCKET_ERROR) {
if ((r = select (nfds, rd, wr, ex, timeout)) == SOCKET_ERROR) {
errno = WSAGetLastError();
switch (errno) {
case WSAEINTR:
Expand Down

0 comments on commit 846ce3e

Please sign in to comment.