зеркало из https://github.com/github/ruby.git
*** empty log message ***
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3493 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
Родитель
937092b820
Коммит
246800d42b
16
eval.c
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
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")
|
||||
|
|
Загрузка…
Ссылка в новой задаче