aboutsummaryrefslogtreecommitdiffstats
path: root/file.c
Commit message (Collapse)AuthorAgeFilesLines
* * ruby.h (struct RArray): embed small arrays.matz2006-09-021-15/+14
| | | | | | | | | | (RARRAY_LEN): defined for accessing array members. (RARRAY_PTR): ditto. * array.c: use RARRAY_LEN and RARRAY_PTR. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@10833 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * file.c (test_identical, rb_file_s_truncate): use RSTRING_PTR andusa2006-08-311-7/+7
| | | | | | | | | | | | | RSTRING_STR. * io.c (pipe_open, rb_io_reopen): ditto. * process.c (proc_spawn_n, rb_spawn): ditto. * util.c (ruby_add_suffix): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@10811 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * ruby.h (struct RString): embed small strings.matz2006-08-311-28/+27
| | | | | | | | | | (RSTRING_LEN): defined for accessing string members. (RSTRING_PTR): ditto. * string.c: use RSTRING_LEN and RSTRING_PTR. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@10810 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Fix documentation submitted by Rick Ohnemus. ruby-Bugs-5529. [ruby-core:08725]drbrain2006-08-271-3/+3
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@10783 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * file.c (rb_file_s_rename): use errno if set properly.nobu2006-08-191-1/+7
| | | | | | | fixed: [ruby-dev:29293] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@10747 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * file.c (rb_stat_[rRwWxX]): check for super user.nobu2006-08-171-1/+27
| | | | | | | fixed: [ruby-core:08616] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@10741 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * object.c (rb_mod_attr): make Module#attr to be an alias tomatz2006-07-201-2/+2
| | | | | | | | | | attr_reader. [RCR#331] * ruby.h: export classes/modules to implement sandbox. [ruby-core:08283] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@10577 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * eval.c, file.c, etc.: code-cleanup patch from Stefan Huehnermatz2006-06-201-1/+1
| | | | | | | <stefan at huehner.org>. [ruby-core:08029] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@10351 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * eval.c (Init_eval): add aliases invoke_method andmatz2006-06-171-1/+2
| | | | | | | | | | | | | | | | | | invoke_functional_method corresponding send and funcall respectively. [ruby-talk:197512] * parse.y (parser_yylex): returns the most typical keyword token on EXPR_FNAME. [ruby-core:7995] * ext/socket/socket.c: protoize. * parse.y (then): remove ':' from 'then' and 'do' rules. * hash.c (env_aset): raise TypeError on nil with more descriptive message. [ruby-core:07990] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@10304 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * file.c: commit miss?ocean2006-02-061-3/+0
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@9905 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * file.c (cygwin_flock): save old errno.eban2006-02-061-1/+4
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@9904 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * file.c (rb_thread_flock): ERROR_NOT_LOCKED is not an error on Cygwin.eban2006-02-061-3/+20
| | | | | | | In such situation, flock() should return 0. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@9903 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * configure.in, dln.c, file.c, intern.h, missing.h (eaccess): usenobu2006-01-251-0/+2
| | | | | | | system routine if provided. fixed: [ruby-core:07195] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@9856 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * file.c (rb_file_s_chmod): avoid warning where sizeof(int) !=ocean2006-01-131-2/+2
| | | | | | | sizeof(void*). git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@9832 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* (rb_f_test): fix document. [ruby-dev:28087]akr2005-12-211-1/+11
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@9731 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * file.c (w32_io_info): should return handle because FileIndex isocean2005-12-211-14/+16
| | | | | | | valid only while file is open. [ruby-dev:28088] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@9730 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * file.c (w32_io_info): CreateFile failed on Win9x if file was alreadyocean2005-11-231-1/+2
| | | | | | | | opened. (FILE_SHARE_READ was needed, but actually I don't understand the flags of CreateFile well...) git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@9604 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * file.c (w32_io_info): should not call GetFileInformationByHandleocean2005-11-231-16/+19
| | | | | | | | | | | for pipe. * file.c (w32_io_info): checks return value from rb_w32_get_osfhandle. * file.c (w32_io_info): now can identify directory on WinNT. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@9600 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * file.c (test_identical): test if two files are identical.nobu2005-11-221-9/+91
| | | | | | | | | | * file.c (rb_f_test): support DOSISH systems where st_ino is not reliable. fixed: [ruby-core:06672] * win32.h, win32.c (rb_w32_osid): check the running platform. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@9590 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * file.c (rb_file_s_basename): skip slashes just after UNC top slashes.usa2005-11-221-1/+3
| | | | | | | | * test/ruby/test_path.rb (test_dirname, test_basename): follow new spec. and add new tests. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@9586 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * file.c (rb_file_s_basename): DOSISH_UNC is defined on cygwin butnobu2005-11-211-3/+3
| | | | | | | DOSISH is not. fixed: [ruby-dev:27797] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@9580 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * file.c (rb_path_skip_prefix, rb_file_s_basename): UNC without pathnobu2005-11-211-3/+26
| | | | | | | should not be splitted. fixed: [ruby-dev:27776] [ruby-dev:27786] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@9578 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * file.c (rb_file_s_dirname): should use skipprefix for UNC path.usa2005-11-181-2/+2
| | | | | | | pointed out by nobu ([ruby-dev:27744]). fixed: [ruby-core:5076] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@9563 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * file.c (file_s_dirname): added checks for some patterns with driveusa2005-11-181-1/+8
| | | | | | | | | | letter. fixed: [ruby-dev:27738] * test/ruby/test_path.rb (test_dirname): added tests for above patterns. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@9559 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * file.c (file_load_ok): eaccess() returns 0 on success.nobu2005-11-151-1/+1
| | | | | | | fixed: [ruby-dev:27713] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@9546 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * file.c (file_load_ok): use eaccess() instead of actually openingmatz2005-11-151-8/+2
| | | | | | | | | | the file. [ruby-talk:156378] * lib/jcode.rb (String::reverse): add new methods. [ruby-list:41245] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@9542 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * file.c (rb_file_s_readlink): ERANGE will occur only on GPFS.nobu2005-11-141-6/+4
| | | | | | | [ruby-dev:27699] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@9537 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * configure.in: undef HAVE_LINK on BeOS. (link(2) always returnsocean2005-11-101-0/+27
| | | | | | | | | | | | EINVAL, and this causes error in test/fileutils.) * file.c: overwride chown(2) and fchown(2) on BeOS. (these functions should not change user/group id if -1 is passed as corresponding argument, and this causes error in test/fileutils too) [ruby-dev:27672] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@9523 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * file.c (rb_file_s_readlink): readlink(2) on AIX fails with ERANGE ifnobu2005-11-061-1/+7
| | | | | | | buffer size is less than required. fixed: [ruby-dev:27634] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@9505 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * eval.c, file.c, ruby.c: removed strchr, strrchr, strstr definitionocean2005-10-201-6/+1
| | | | | | | | | because they are defined in missing.h. * missing.h, missing/strchr.c, missing/strstr.c: ANSI styled. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@9427 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * file.c (rb_file_join): elements may contain null pointer strings.nobu2005-10-181-1/+1
| | | | | | | report and fixed by Lloyd Zusman (hippoman): [ruby-core:06326] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@9415 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * file.c (rb_f_test): typos in RDoc comments.eban2005-10-121-3/+3
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@9380 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * file.c (rb_f_test): typo in RDoc comments.eban2005-10-121-1/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@9378 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * array.c, enum.c, eval.c, util.c: safer function pointer usage.nobu2005-10-111-1/+2
| | | | | | | | | | fixed: [ruby-core:06143] * util.h (qsort): removed the definition incompatible to ANSI. fixed: [ruby-core:06147] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@9374 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * range.c (rb_range_beg_len): should return Qfalse for non-rangematz2005-10-051-7/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | object. * pack.c (EXTEND16): [ruby-dev:27383] * eval.c (set_trace_func): add rb_secure(4) to prevent adding tracing function. * lib/delegate.rb: document update from James Edward Gray II <james@grayproductions.net>. [ruby-core:05942] * process.c (proc_daemon): should restrict execution on levels higher than $SAFE=2. suggested by URABE Shyouhei <shyouhei@ice.uec.ac.jp>. * lib/forwardable.rb: replaced by new implementation from <Daniel.Berger@qwest.com>. [ruby-core:05899] * file.c (path_check_0): disallow sticky world writable directory in PATH (and $LOAD_PATH). [ruby-dev:27226] * numeric.c (fix_idiv): 1.div(1.0) should return integer value. [ruby-dev:27235] * lib/yaml.rb: require 'yaml/constants'. [ruby-core:5776] * lib/xmlrpc/client.rb (XMLRPC::Client::do_rpc): add charset information to content-type header.[ruby-core:5127] * lib/xmlrpc/server.rb (CGIServer::serve): ditto. * lib/xmlrpc/server.rb (ModRubyServer::serve): ditto. * lib/xmlrpc/server.rb (WEBrickServlet::service): ditto. * test/dbm/test_dbm.rb (TestDBM::test_s_open_error): remove test_s_open_error test to detect duplicate open. [ruby-dev:27202] * eval.c (splat_value): use to_a to splat non Array object. * object.c (nil_to_a): remove nil.to_a. [experimental] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@9349 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * file.c (rb_stat_inspect): constified.nobu2005-09-281-2/+2
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@9330 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * file.c (rb_stat_inspect): protoized function pointer.nobu2005-09-201-38/+38
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@9251 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * file.c (rb_thread_flock): should have resolved conflict.matz2005-09-191-9/+0
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@9239 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * io.c (io_close): call rb_io_close() directly if io is a T_FILEmatz2005-09-191-2/+13
| | | | | | | | | | | | | | | | | | | | | | | | object. [ruby-dev:27156] * file.c (file_expand_path): allow pathnames to expand. [ruby-dev:27152] * numeric.c (Init_Numeric): should define Fixnum#div. [ruby-dev:27129] * file.c (rb_thread_flock): wrap flock(2) by TRAP_BEG and TRAP_END. [ruby-dev:27122] * file.c (rb_file_join): call FilePathValue() to all Pathnames to join. [ruby-dev:27127] * file.c (rb_get_path): call StringValueCStr() to ensure no nul bytes in path strings. * gc.c (garbage_collect): need value for return. [ruby-dev:27127] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@9236 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * file.c (rb_file_chown): should accept nil. [ruby-dev:27171]aamine2005-09-191-2/+2
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@9232 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * file.c (rb_thread_flock): wrap the flock system call byakr2005-09-181-1/+5
| | | | | | | | | | | | | | | TRAP_BEG/TRAP_END to enable signals. [ruby-dev:27122] * ext/socket/socket.c (bsock_send): wrap the sendto and send system call by TRAP_BEG/TRAP_END to enable signals when writing to a socket which is full. [ruby-dev:27132] * io.c (rb_io_syswrite): wrap the write system call by TRAP_BEG/TRAP_END to run signal hander in syswrite method. [ruby-dev:27134] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@9212 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * file.c (rb_file_join): convert components by to_s instead of to_str.nobu2005-09-171-7/+2
| | | | | | | fixed: [ruby-dev:27127] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@9204 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * test/socket/test_tcp.rb (TestTCPSocket::test_recvfrom): typomatz2005-09-171-0/+1
| | | | | | | | | | | | | fixed. [ruby-dev:27123] * string.c (rb_str_substr): should propagate taintness even for empty strings. [ruby-dev:27121] * string.c (rb_str_aref): should infect result if range argument is tainted. [ruby-dev:27121] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@9199 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * file.c (rb_file_s_extname): empty string for path name ending with anobu2005-09-161-5/+12
| | | | | | | | | | period. fixed: [ruby-core:05651] * file.c (rb_file_join): smarter behavior at edge cases. fixed: [ruby-core:05706] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@9181 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * bignum.c: changed `foo _((boo))' to `foo(boo)`. [ruby-dev:27056]ocean2005-09-141-6/+6
| | | | | | | | | | | * defines.h, dir.c, dln.h, enumerator.c, env.h, error.c, eval.c, file.c, gc.c, hash.c, inits.c, intern.h, io.c, lex.c, marshal.c, missing.h, node.h, numeric.c, pack.c, process.c, re.h, ruby.c, ruby.h, rubyio.h, rubysig.h, signal.c, sprintf.c, st.h, string.c, struct.c, time.c, util.c, util.h, variable.c: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@9155 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * file.c (apply2files): stricter callback definition.nobu2005-09-121-36/+24
| | | | | | | * file.c (rb_path_check): constified. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@9131 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * array.c: moved to ANSI function style from K&R function style.ocean2005-09-121-312/+144
| | | | | | | | | | | | | | | | | (used protoize on windows, so still K&R remains on #ifdef part of other platforms. And `foo _((boo))' stuff is still there) [ruby-dev:26975] * bignum.c, class.c, compar.c, dir.c, dln.c, dmyext.c, enum.c, enumerator.c, error.c, eval.c, file.c, gc.c, hash.c, inits.c, io.c, main.c, marshal.c, math.c, numeric.c, object.c, pack.c, prec.c, process.c, random.c, range.c, re.c, regcomp.c, regenc.c, regerror.c, regexec.c, regparse.c, regparse.h, ruby.c, signal.c, sprintf.c, st.c, string.c, struct.c, time.c, util.h, variable.c, version.c: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@9126 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * eval.c (rb_eval): pre-evaluate argument for unambiguousmatz2005-06-301-1/+1
| | | | | | | | | | | | | | evaluation order. [ruby-dev:26383] * lib/delegate.rb (Delegator::method_missing): forward unknown method to the destination. suggested by <christophe.poucet@gmail.com>. [ruby-talk:146776] * process.c (detach_process_watcher): terminate process watcher thread right after rb_waitpid() succeed. [ruby-talk:146430] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@8676 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * eval.c (search_required, rb_require_safe): expand path innobu2005-04-181-1/+1
| | | | | | | | | | | rb_features. [ruby-dev:26079] * file.c (rb_find_file_ext): return absolute path. * ext/extmk.rb: expand path for ext/**/extconf.rb. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@8349 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * dir.c, file.c (lstat): avoid warnings for mingw.eban2005-04-111-2/+2
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@8304 b2dd03c8-39d4-4d8f-98ff-823fe69b080e