git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3493 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
nobu 2003-02-13 09:58:57 +00:00
Родитель 937092b820
Коммит 246800d42b
3 изменённых файлов: 15 добавлений и 9 удалений

16
eval.c
Просмотреть файл

@ -7406,6 +7406,14 @@ enum thread_status {
/* +infty, for this purpose */
#define DELAY_INFTY 1E30
#if !defined HAVE_PAUSE
# if defined _WIN32 && !defined __CYGWIN__
# define pause() Sleep(INFINITE)
# else
# define pause() sleep(0x7fffffff)
# endif
#endif
/* typedef struct thread * rb_thread_t; */
struct thread {
@ -8642,14 +8650,6 @@ rb_thread_sleep(sec)
rb_thread_wait_for(rb_time_timeval(INT2FIX(sec)));
}
#if !defined HAVE_PAUSE
# if defined _WIN32 && !defined __CYGWIN__
# define pause() Sleep(INFINITE)
# else
# define pause() sleep(0x7fffffff)
# endif
#endif
void
rb_thread_sleep_forever()
{

1
file.c
Просмотреть файл

@ -1755,7 +1755,6 @@ rb_file_s_basename(argc, argv)
if (NIL_P(fext) || !(f = rmext(p, ext))) {
f = chompdirsep(p) - p;
}
basename = rb_str_new(p, f);
}
basename = rb_str_new(p, f);
OBJ_INFECT(basename, fname);

Просмотреть файл

@ -1655,9 +1655,16 @@ test_check "path"
test_ok(File.basename("a") == "a")
test_ok(File.basename("a/b") == "b")
test_ok(File.basename("a/b/") == "b")
test_ok(File.basename("/") == "/")
test_ok(File.basename("//") == "/")
test_ok(File.basename("///") == "/")
test_ok(File.basename("a/b////") == "b")
test_ok(File.basename("a.rb", ".rb") == "a")
test_ok(File.basename("a.rb///", ".rb") == "a")
test_ok(File.basename("a.rb///", ".*") == "a")
test_ok(File.basename("a.rb///", ".c") == "a.rb")
test_ok(File.dirname("a") == ".")
test_ok(File.dirname("/") == "/")
test_ok(File.dirname("/a") == "/")
test_ok(File.dirname("a/b") == "a")
test_ok(File.dirname("a/b/c") == "a/b")