summaryrefslogtreecommitdiffstats
path: root/file.c
Commit message (Collapse)AuthorAgeFilesLines
* * 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: http://svn.ruby-lang.org/repos/ruby/branches/ruby_1_8@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: http://svn.ruby-lang.org/repos/ruby/branches/ruby_1_8@9600 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * intern.h, file.c: failed to compile on windows.ocean2005-11-231-4/+4
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/branches/ruby_1_8@9593 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * file.c (test_identical): test if two files are identical.nobu2005-11-221-9/+94
| | | | | | | | | | * 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: http://svn.ruby-lang.org/repos/ruby/branches/ruby_1_8@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: http://svn.ruby-lang.org/repos/ruby/branches/ruby_1_8@9587 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: http://svn.ruby-lang.org/repos/ruby/branches/ruby_1_8@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: http://svn.ruby-lang.org/repos/ruby/branches/ruby_1_8@9578 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * file.c (rb_file_s_dirname): should use skipprefix for UNC path.usa2005-11-181-1/+1
| | | | | | | pointed out by nobu ([ruby-dev:27744]). fixed: [ruby-core:5076] git-svn-id: http://svn.ruby-lang.org/repos/ruby/branches/ruby_1_8@9563 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * file.c (file_s_dirname): added checks for some patterns with driveusa2005-11-181-2/+9
| | | | | | | | | | letter. fixed: [ruby-dev:27738] * test/ruby/test_path.rb (test_dirname): added tests for above patterns. git-svn-id: http://svn.ruby-lang.org/repos/ruby/branches/ruby_1_8@9561 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: http://svn.ruby-lang.org/repos/ruby/branches/ruby_1_8@9537 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * configure.in: undef HAVE_LINK on BeOS. (link(2) always returnsocean2005-11-101-0/+32
| | | | | | | | | | | | | | 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] * file.c (rb_file_s_link): checks HAVE_LINK. git-svn-id: http://svn.ruby-lang.org/repos/ruby/branches/ruby_1_8@9524 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: http://svn.ruby-lang.org/repos/ruby/branches/ruby_1_8@9505 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: http://svn.ruby-lang.org/repos/ruby/branches/ruby_1_8@9415 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * file.c (chmod_internal, lchmod_internal): fixed type of 2nd argument.usa2005-10-171-4/+8
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/branches/ruby_1_8@9403 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * file.c (rb_f_test): typos in RDoc comments.eban2005-10-121-3/+3
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/branches/ruby_1_8@9380 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * file.c (rb_f_test): typo in RDoc comments.eban2005-10-121-1/+1
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/branches/ruby_1_8@9378 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * class.c (rb_mod_init_copy, rb_class_init_copy), file.c (rb_stat_init_copy),nobu2005-09-281-0/+1
| | | | | | | | | numeric.c (num_init_copy), object.c (rb_obj_init_copy, Init_Object), re.c (match_init_copy, rb_reg_init_copy), time.c (time_init_copy): undocumented. git-svn-id: http://svn.ruby-lang.org/repos/ruby/branches/ruby_1_8@9332 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * file.c (apply2files): add prototype.nobu2005-09-281-43/+66
| | | | | | | * file.c (rb_stat_inspect): constified. git-svn-id: http://svn.ruby-lang.org/repos/ruby/branches/ruby_1_8@9331 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * file.c (fpath_check): typo fixed.matz2005-09-201-1/+1
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/branches/ruby_1_8@9256 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * file.c (path_check_0): disallow sticky world writable directorymatz2005-09-201-9/+21
| | | | | | | in PATH (and $LOAD_PATH). [ruby-dev:27226] git-svn-id: http://svn.ruby-lang.org/repos/ruby/branches/ruby_1_8@9255 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * file.c (rb_file_chown): should accept nil. [ruby-dev:27171] (backport from ↵aamine2005-09-191-2/+2
| | | | | | trunk, rev 1.208) git-svn-id: http://svn.ruby-lang.org/repos/ruby/branches/ruby_1_8@9233 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 enable signals when writing to a pipe which is full. [ruby-dev:27134] git-svn-id: http://svn.ruby-lang.org/repos/ruby/branches/ruby_1_8@9211 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * file.c (file_inspect_join): commit miss, applied a patch for old trunk.nobu2005-09-161-1/+0
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/branches/ruby_1_8@9185 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * file.c (file_inspect_join): missing argument declaration.nobu2005-09-161-0/+1
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/branches/ruby_1_8@9182 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: http://svn.ruby-lang.org/repos/ruby/branches/ruby_1_8@9181 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * dir.c, file.c (lstat): avoid warnings for mingw.eban2005-04-111-2/+2
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/branches/ruby_1_8@8304 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* typo fixakr2005-03-021-1/+1
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/branches/ruby_1_8@8055 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * dir.c (dir_open_dir): new function. [ruby-dev:25242]matz2004-12-181-1/+1
| | | | | | | | | | | | | | | | | | * hash.c (Init_Hash): remove custom "hash" and "eql?". * lib/set.rb (Set::eql): wrong definition. [ruby-dev:25207] * object.c (rb_obj_id_obsolete): warn always. * eval.c (rb_enable_super): ditto. * lib/set.rb (Set#==): [ruby-dev:25206] * lib/pstore.rb (PStore#transaction): Use the empty content when a file is not found. [ruby-dev:24561] git-svn-id: http://svn.ruby-lang.org/repos/ruby/branches/ruby_1_8@7592 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * file.c (rb_file_chown): [ruby-dev:24949]matz2004-11-221-1/+1
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/branches/ruby_1_8@7357 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * file.c (rb_file_chown): integer conversion should be prior tomatz2004-11-221-7/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | GetOpenFile(). [ruby-dev:24947] * file.c (rb_file_truncate): ditto. * file.c (rb_file_s_truncate): ditto. * dir.c (dir_seek): use NUM2OFFT(). * misc/ruby-mode.el (ruby-non-block-do-re): [ruby-core:03719] * dir.c (dir_seek): should retrieve dir_data after NUM2INT(). [ruby-dev:24941] * string.c (rb_str_splice): should place index wrapping after possible modification. [ruby-dev:24940] * eval.c (error_print): nicer traceback at interrupt. [ruby-core:03774] * string.c (str_gsub): internal buffer should not be listed by ObjectSpace.each_object() by String#gsub. [ruby-dev:24931] * lib/cgi/session.rb (CGI::Session::FileStore::initialize): raise exception if data corresponding to session specified from the client does not exist. * string.c (str_gsub): internal buffer should not be listed by ObjectSpace.each_object(). [ruby-dev:24919] git-svn-id: http://svn.ruby-lang.org/repos/ruby/branches/ruby_1_8@7354 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * io.c (rb_io_check_initialized): new function to check uninitializednobu2004-10-291-0/+1
| | | | | | | | | object. [ruby-talk:118234] * file.c (rb_file_path), io.c (rb_io_closed): check if initialized. git-svn-id: http://svn.ruby-lang.org/repos/ruby/branches/ruby_1_8@7140 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * eval.c (rb_load, search_required, rb_require_safe, rb_require): usenobu2004-10-231-1/+7
| | | | | | | frozen shared string to avoid outside modification. [ruby-dev:24580] git-svn-id: http://svn.ruby-lang.org/repos/ruby/branches/ruby_1_8@7106 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * file.c (rb_file_truncate): discard read buffer before truncation.nobu2004-10-171-0/+4
| | | | | | | [ruby-dev:24197] git-svn-id: http://svn.ruby-lang.org/repos/ruby/branches/ruby_1_8@7057 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * string.c (rb_str_sum): check was done with false pointer.matz2004-10-021-6/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | [ruby-dev:24383] * string.c (rb_str_sum): string may be altered. [ruby-dev:24381] * eval.c (rb_f_eval): defer pointer retrieval to prevent unsafe sourcefile string modification. [ruby-dev:24373] * io.c (io_read): block string buffer modification during rb_io_fread() by freezing it temporarily. [ruby-dev:24366] * io.c (rb_io_s_popen): mode argument may be altered. [ruby-dev:24375] * file.c (rb_file_s_basename): ext argument may be altered. [ruby-dev:24377] * enum.c (enum_sort_by): use NODE instead of 2 element arrays. [ruby-dev:24378] * string.c (rb_str_chomp_bang): StringValue() may change the receiver. [ruby-dev:24371] git-svn-id: http://svn.ruby-lang.org/repos/ruby/branches/ruby_1_8@6979 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * array.c (rb_ary_equal): element size might change duringmatz2004-09-181-2/+5
| | | | | | | | | | | | | | | | | | | | | | | comparison. [ruby-dev:24254] * array.c (rb_ary_diff): ditto. [ruby-dev:24274] * array.c (rb_ary_select): ditto. [ruby-dev:24278] * array.c (rb_ary_delete): ditto. [ruby-dev:24283] * array.c (rb_ary_rindex): ditto. [ruby-dev:24275] * array.c (rb_ary_initialize): element size might change during initializing block. [ruby-dev:24284] * dir.c (dir_s_chdir): avoid memory leak and unnecessary chdir to the original directory when exception has caused in changing direcotry or within block. thanks to Johan Holmberg <holmberg@iar.se> [ruby-core:03446] git-svn-id: http://svn.ruby-lang.org/repos/ruby/branches/ruby_1_8@6922 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * eval.c (THREAD_ALLOC): th->thread should be initialized to NULL.matz2004-07-171-0/+48
| | | | | | | | | | [ruby-talk:106657] The solution was found by Guy Decoux. * file.c (rb_stat_dev_major): new methods File::Stat#dev_major and #dev_minor. [ruby-core:03195] git-svn-id: http://svn.ruby-lang.org/repos/ruby/branches/ruby_1_8@6656 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * array.c, enum.c, eval.c, file.c, io.c, numeric.c, object.c, prec.c,nobu2004-04-141-1/+1
| | | | | | | process.c, re.c, string.c: typos in RDoc comments. [ruby-core:02783] git-svn-id: http://svn.ruby-lang.org/repos/ruby/branches/ruby_1_8@6158 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * eval.c (top_include): include in the wrapped load is done formatz2004-04-051-2/+2
| | | | | | | | | | | | | | | | | | the wrapper, not for a singleton class for wrapped main. [ruby-dev:23305] * bignum.c (rb_big_eq): use temporary double variable to save the result (internal float register may be bigger than 64 bits, for example, 80 bits on x86). [ruby-dev:23311] * eval.c (block_pass): should generate unique identifier of the pushing block. [ruby-talk:96363] * ext/socket/socket.c (make_hostent): fix memory leak, based on the patch from HORIKAWA Hisashi <vzw00011@nifty.ne.jp>. git-svn-id: http://svn.ruby-lang.org/repos/ruby/branches/ruby_1_8@6092 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * file.c (test_l): fix wrong method name in document.akr2004-02-031-7/+7
| | | | | | | | | | | | (test_S): ditto. (test_b): ditto. (test_c): ditto. (test_suid): ditto. (test_sgid): ditto. (test_sticky): ditto. git-svn-id: http://svn.ruby-lang.org/repos/ruby/branches/ruby_1_8@5620 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * stable version 1.8.1 released.matz2003-12-241-5/+1
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@5284 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Add file.c comments (and necessary support in parse_c.rb)dave2003-12-211-0/+1182
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@5234 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * file.c: renamed and externalized rb_path_next,nobu2003-12-151-4/+4
| | | | | | | rb_path_skip_prefix, rb_path_last_separator, rb_path_end. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@5194 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * dir.c (check_dirname): check string safety and remove extraneousnobu2003-12-151-8/+10
| | | | | | | | | | | | | trailing directory separators. [ruby-dev:22279] * file.c: extern rb_path_next, rb_path_skip_prefix, rb_path_last_separator, rb_path_end. * intern.h: prototypes for rb_path_next, rb_path_skip_prefix, rb_path_last_separator, rb_path_end. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@5191 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * configure.in (ieeefp.h), numeric.c: needed for finite() onnobu2003-12-111-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Solaris. [ruby-core:01921] * file.c (rb_stat_inspect): adjust format specifier. * parse.c (arg_prepend): nodetype() is for debug use. * ruby.h (ISASCII, etc): cast to int to get rid of warning. * ruby.h (alloca.h): include even in GCC. [ruby-core:01925] * ext/bigdecimal/bigdecimal.c (GetVpValue): adjust format specifier. * ext/bigdecimal/bigdecimal.c (BigDecimal_prec, BigDecimal_coerce, BigDecimal_divmod): use rb_assoc_new() to suppress memory usage. * ext/bigdecimal/bigdecimal.c (BigDecimal_split): ditto. * ext/dl/sym.c (rb_dlsym_guardcall): guard itself should be volatile. * ext/iconv/iconv.c (iconv_convert): ensure actual parameter with format specifier. * ext/pty/pty.c (MasterDevice, SlaveDevice, deviceNo): do not define unless used. * ext/pty/pty.c (getDevice): get rid of warning. * ext/socket/socket.c (port_str, sock_s_getaddrinfo, sock_s_getnameinfo): FIX2INT() now returns long. * ext/socket/socket.c (init_inetsock_internal): uninitialized variable. * ext/syck/rubyext.c (syck_parser_assign_io): add prototype. * ext/syck/rubyext.c (rb_syck_mktime, yaml_org_handler): use ISDIGIT() instead of isdigit() to avoid warnings and for platforms which don't support non-ascii charater. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@5163 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * gc.c (gc_mark): explicitly check mark recursion levels, insteadmatz2003-11-281-1/+1
| | | | | | | | | | of unreliable stack length. * file.c (path_check_1): honor sticky bits always. [ruby-talk:86273] git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@5057 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * gc.c (Init_stack): stack region is far smaller than usual ifmatz2003-11-221-10/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | pthread is used. * marshal.c (w_extended): singleton methods should not be checked when dumping via marshal_dump() or _dump(). [ruby-talk:85909] * file.c (getcwdofdrv): avoid using getcwd() directly, use my_getcwd() instead. * merged NeXT, OpenStep, Rhapsody ports patch from Eric Sunshine <sunshine@sunshineco.com>. [ruby-core:01596] * marshal.c (w_object): LINK check earlier than anything else, i.e. do not dump TYPE_IVAR for already dumped objects. (ruby-bugs PR#1220) * eval.c (rb_eval): call "inherited" only when a new class is generated; not on reopening. * eval.c (eval): prepend error position in evaluating string to * configure.in: revived NextStep, OpenStep, and Rhapsody ports which had become unbuildable; enhanced --enable-fat-binary option so that it accepts a list of desired architectures (rather than assuming a fixed list), or defaults to a platform-appropriate list if user does not provide an explicit list; made the default list of architectures for MAB (fat binary) more comprehensive; now uses -fno-common even when building the interpreter (in addition to using it for extensions), thus allowing the interpreter to be embedded into a plugin module of an external project (in addition to allowing embedding directly into an application); added checks for <netinet/in_systm.h> (needed by `socket' extension) and getcwd(); now ensures that -I/usr/local/include is employed when extensions' extconf.rb scripts invoke have_header() since extension checks on NextStep and OpenStep will fail without it if the desired resource resides in the /usr/local tree; fixed formatting of --help message. * Makefile.in: $(LIBRUBY_A) rule now deletes the archive before invoking $(AR) since `ar' on Apple/NeXT can not "update" MAB archives (see configure's --enable-fat-binary option); added rule for new missing/getcwd.c. * defines.h: fixed endian handling during MAB build (see configure's --enable-fat-binary option) to ensure that all portions of the project see the correct WORDS_BIGENDIAN value (some extension modules were getting the wrong endian setting); added missing constants GETPGRP_VOID, WNOHANG, WUNTRACED, X_OK, and type pid_t for NextStep and OpenStep; removed unnecessary and problematic HAVE_SYS_WAIT_H define in NeXT section. * dir.c: do not allow NAMLEN() macro to trust dirent::d_namlen on NextStep since, on some installations, this value always resolves uselessly to zero. * dln.c: added error reporting to NextStep extension loader since the previous behavior of failing silently was not useful; now ensures that NSLINKMODULE_OPTION_BINDNOW compatibility constant is defined for OpenStep and Rhapsody; no longer includes <mach-o/dyld.h> twice on Rhapsody since this header lacks multiple-include protection, which resulted in "redefinition" compilation errors. * main.c: also create hard reference to objc_msgSend() on NeXT platforms (in addition to Apple platforms). * lib/mkmf.rb: now exports XCFLAGS from configure script to extension makefiles so that extensions can be built MAB (see configure's --enable-fat-binary option); also utilize XCFLAGS in cc_command() (but not cpp_command() because MAB flags are incompatible with direct invocation of `cpp'). * ext/curses/extconf.rb: now additionally checks for presence of these curses functions which are not present on NextStep or Openstep: bkgd(), bkgdset(), color(), curs(), getbkgd(), init(), scrl(), set(), setscrreg(), wattroff(), wattron(), wattrset(), wbkgd(), wbkgdset(), wscrl(), wsetscrreg() * ext/curses/curses.c: added appropriate #ifdef's for additional set of curses functions now checked by extconf.rb; fixed curses_bkgd() and window_bkgd() to correctly return boolean result rather than numeric result; fixed window_getbkgd() to correctly signal an error by returning nil rather than -1. * ext/etc/etc.c: setup_passwd() and setup_group() now check for null pointers before invoking rb_tainted_str_new2() upon fields extracted from `struct passwd' and `struct group' since null pointers in some fields are common on NextStep/OpenStep (especially so for the `pw_comment' field) and rb_tainted_str_new2() throws an exception when it receives a null pointer. * ext/pty/pty.c: include "util.h" for strdup()/ruby_strdup() for platforms such as NextStep and OpenStep which lack strdup(). * ext/socket/getaddrinfo.c: cast first argument of getservbyname(), gethostbyaddr(), and gethostbyname() from (const char*) to non-const (char*) for older platforms such as NextStep and OpenStep. * ext/socket/socket.c: include "util.h" for strdup()/ruby_strdup() for platforms such as NextStep and OpenStep which lack strdup(); include <netinet/in_systm.h> if present for NextStep and OpenStep; cast first argument of gethostbyaddr() and getservbyname() from (const char*) to non-const (char*) for older platforms. * ext/syslog/syslog.c: include "util.h" for strdup()/ruby_strdup() for platforms such as NextStep and OpenStep which lack strdup(). git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@5002 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * io.c (read_all): fptr->f may be NULL, if IO is closed in thematz2003-11-041-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | signal handler. * io.c (io_read): ditto. * string.c (get_pat): remove 1.8.0 warning code. * string.c (rb_str_match): extend warning until 1.8.2. * string.c (rb_str_match2): ditto. * class.c (class_instance_method_list): remove 1.8.0 warnings. method_list now recurs. [ruby-dev:21816] * class.c (rb_obj_singleton_methods): ditto. * array.c (rb_ary_select): remove select with block. [ruby-dev:21824] * hash.c (rb_hash_select): ditto. * hash.c (env_select): ditto. * re.c (match_select): ditto. * struct.c (rb_struct_select): ditto. * process.c (check_uid_switch): remove duplicated error messages. * process.c (check_gid_switch): ditto. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@4892 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * hash.c (rb_hash_each): Hash#each should yield single value.matz2003-10-241-1/+1
| | | | | | | | | [ruby-talk:84420] * hash.c (env_each): ditto for ENV.each. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@4839 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * eval.c (ruby_cleanup): call finalizers and exit procs beforematz2003-10-211-1/+1
| | | | | | | | | terminating threads. * eval.c (ruby_cleanup): preserve ruby_errinfo before ruby_finalize_0(). git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@4826 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * file.c (rb_file_s_expand_path): avoid calling rb_scan_args() formatz2003-08-231-0/+4
| | | | | | | apparent cases. [ruby-talk:79748] git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@4439 b2dd03c8-39d4-4d8f-98ff-823fe69b080e