1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

*** 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:
nobu 2003-02-13 09:58:57 +00:00
parent 937092b820
commit 246800d42b
3 changed files with 15 additions and 9 deletions

16
eval.c
View file

@ -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
View file

@ -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);

View file

@ -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")