Граф коммитов

201 Коммитов

Автор SHA1 Сообщение Дата
nobu 8121738943 * eval.c (search_required, rb_require_safe): expand path in
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
2005-04-18 15:01:21 +00:00
eban 4f6e8bade5 * dir.c, file.c (lstat): avoid warnings for mingw.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@8304 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2005-04-11 13:30:10 +00:00
usa 302b8ff055 * file.c (eaccess): workaround for VC++8 runtime.
* win32/win32.c (ioinfo): VC++8 support.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@8072 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2005-03-04 17:42:55 +00:00
matz 70bbad3cfd * array.c: replace rb_protect_inspect() and rb_inspecting_p() by
rb_exec_recursive() in eval.c.

* eval.c (rb_exec_recursive): new function.

* array.c (rb_ary_join): use rb_exec_recursive().

* array.c (rb_ary_inspect, rb_ary_hash): ditto.

* file.c (rb_file_join): ditto.

* hash.c (rb_hash_inspect, rb_hash_to_s, rb_hash_hash): ditto.

* io.c (rb_io_puts): ditto.

* object.c (rb_obj_inspect): ditto

* struct.c (rb_struct_inspect): ditto.

* lib/set.rb (SortedSet::setup): a hack to shut up warning.
  [ruby-talk:132866]

* lib/time.rb (Time::strptime): add new function.  inspired by
  [ruby-talk:132815].

* lib/parsedate.rb (ParseDate::strptime): ditto.

* regparse.c: move st_*_strend() functions from st.c.  fixed some
  potential memory leaks.

* exception error messages updated.  [ruby-core:04497]

* ext/socket/socket.c (Init_socket): add bunch of Socket
  constants.  Patch from Sam Roberts <sroberts@uniserve.com>.
  [ruby-core:04409]

* array.c (rb_ary_s_create): no need for negative argc check.
  [ruby-core:04463]

* array.c (rb_ary_unshift_m): ditto.

* lib/xmlrpc/parser.rb (XMLRPC::FaultException): make it subclass
  of StandardError class, not Exception class.  [ruby-core:04429]

* parse.y (fcall_gen): lvar(arg) will be evaluated as
  lvar.call(arg) when lvar is a defined local variable. [new]

* object.c (rb_class_initialize): call inherited method before
  calling initializing block.

* eval.c (rb_thread_start_1): initialize newly pushed frame.

* lib/open3.rb (Open3::popen3): $? should not be EXIT_FAILURE.
  fixed: [ruby-core:04444]

* eval.c (is_defined): NODE_IASGN is an assignment.

* ext/readline/readline.c (Readline.readline): use rl_outstream
  and rl_instream.  [ruby-dev:25699]

* ext/etc/etc.c (Init_etc): sGroup needs HAVE_ST_GR_PASSWD check
  [ruby-dev:25675]

* misc/ruby-mode.el: [ruby-core:04415]

* lib/rdoc/generators/html_generator.rb: [ruby-core:04412]

* lib/rdoc/generators/ri_generator.rb: ditto.

* struct.c (make_struct): fixed: [ruby-core:04402]

* ext/curses/curses.c (window_color_set): [ruby-core:04393]

* ext/socket/socket.c (Init_socket): SO_REUSEPORT added.
  [ruby-talk:130092]

* object.c: [ruby-doc:818]

* parse.y (open_args): fix too verbose warnings for the space
  before argument parentheses.  [ruby-dev:25492]

* parse.y (parser_yylex): ditto.

* parse.y (parser_yylex): the first expression in the parentheses
  should not be a command.  [ruby-dev:25492]

* lib/irb/context.rb (IRB::Context::initialize): [ruby-core:04330]

* object.c (Init_Object): remove Object#type.  [ruby-core:04335]

* st.c (st_foreach): report success/failure by return value.
  [ruby-Bugs-1396]

* parse.y: forgot to initialize parser struct.  [ruby-dev:25492]

* parse.y (parser_yylex): no tLABEL on EXPR_BEG.
  [ruby-talk:127711]

* document updates - [ruby-core:04296], [ruby-core:04301],
  [ruby-core:04302], [ruby-core:04307]

* dir.c (rb_push_glob): should work for NUL delimited patterns.

* dir.c (rb_glob2): should aware of offset in the pattern.

* string.c (rb_str_new4): should propagate taintedness.

* env.h: rename member names in struct FRAME; last_func -> callee,
  orig_func -> this_func, last_class -> this_class.

* struct.c (rb_struct_set): use original method name, not callee
  name, to retrieve member slot.  [ruby-core:04268]

* time.c (time_strftime): protect from format modification from GC
  finalizers.

* object.c (Init_Object): remove rb_obj_id_obsolete()

* eval.c (rb_mod_define_method): incomplete subclass check.
  [ruby-dev:25464]

* gc.c (rb_data_object_alloc): klass may be NULL.
  [ruby-list:40498]

* bignum.c (rb_big_rand): should return positive random number.
  [ruby-dev:25401]

* bignum.c (rb_big_rand): do not use rb_big_modulo to generate
  random bignums.  [ruby-dev:25396]

* variable.c (rb_autoload): [ruby-dev:25373]

* eval.c (svalue_to_avalue): [ruby-dev:25366]

* string.c (rb_str_justify): [ruby-dev:25367]

* io.c (rb_f_select): [ruby-dev:25312]

* ext/socket/socket.c (sock_s_getservbyport): [ruby-talk:124072]

* struct.c (make_struct): [ruby-dev:25249]

* dir.c (dir_open_dir): new function.  [ruby-dev:25242]

* io.c (rb_f_open): add type check for return value from to_open.

* lib/pstore.rb (PStore#transaction): Use the empty content when a
  file is not found.  [ruby-dev:24561]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@8068 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2005-03-04 06:47:45 +00:00
akr 6f3016a969 typo fix
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@8055 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2005-03-02 12:38:23 +00:00
akr a435e52259 * io.c (io_fwrite): avoid context switch before writing to stderr.
[ruby-dev:25080]

* rubyio.h: refine deprecated declaration.

* configure.in, file.c, io.c: remove useless check: fseeko, etc.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@7490 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2004-12-07 06:44:42 +00:00
akr 04f36c2bba * rubyio.h, intern.h, io.c, file.c, process.c, ext/socket/socket.c,
ext/pty/pty.c, ext/io/wait/wait.c, ext/openssl/ossl_ssl.c:
  Use own buffering mechanism instead of stdio.

* io.c, ext/stringio/stringio.c, test/ruby/ut_eof.rb:
  EOF flag removed.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@7473 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2004-12-06 08:40:30 +00:00
matz 941d135904 * file.c (rb_file_chown): [ruby-dev:24949]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@7357 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2004-11-22 17:02:45 +00:00
matz f50136a311 * file.c (rb_file_chown): integer conversion should be prior to
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]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@7353 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2004-11-22 15:26:02 +00:00
nobu 9f5f676d82 * io.c (rb_io_check_initialized): new function to check uninitialized
object.  [ruby-talk:118234]

* file.c (rb_file_path), io.c (rb_io_closed): check if initialized.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@7140 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2004-10-29 12:28:32 +00:00
nobu d0c2e3c7c9 * eval.c (rb_load, search_required, rb_require_safe, rb_require): use
frozen shared string to avoid outside modification.  [ruby-dev:24580]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@7106 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2004-10-23 15:41:17 +00:00
nobu 2cb2ef977c * file.c (rb_file_truncate): discard read buffer before truncation.
[ruby-dev:24197]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@7057 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2004-10-17 22:26:58 +00:00
matz 1b4d97ddba * 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: svn+ssh://ci.ruby-lang.org/ruby/trunk@6976 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2004-10-01 15:56:05 +00:00
matz f1f0f39e03 * hash.c (rb_hash_rehash): replace st_foreach() by its deep
checking counterpart.  [ruby-dev:24310]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@6953 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2004-09-23 00:51:32 +00:00
matz e77ddaf0d1 * array.c (rb_ary_delete): element comparison might change array
size. [ruby-dev:24273]

* parse.y: make ruby parser reentrant. merge ripper parser to the
  real one.  this change makes ruby require bison.

* file.c (rb_file_truncate): clear stdio buffer before truncating
  the file.  [ruby-dev:24191]

* ext/digest/digest.c: use rb_obj_class() instead of CLASS_OF
  which might return singleton class.  [ruby-dev:24202]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@6919 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2004-09-17 09:24:13 +00:00
matz 15ba9f85cf * eval.c (THREAD_ALLOC): th->thread should be initialized to NULL.
[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: svn+ssh://ci.ruby-lang.org/ruby/trunk@6656 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2004-07-17 02:23:52 +00:00
matz 4f127ee34b * io.c (rb_io_gets_m): set lastline ($_) even when read line is
nil.  [ruby-dev:23663]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@6427 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2004-06-04 09:56:25 +00:00
nobu d952e33003 * array.c, enum.c, eval.c, file.c, io.c, numeric.c, object.c, prec.c,
process.c, re.c, string.c: typos in RDoc comments.  [ruby-core:02783]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@6158 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2004-04-14 04:06:52 +00:00
matz df84c64be9 * pack.c (pack_pack): use NUM2INT() instead of num2i32().
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@6120 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2004-04-07 06:30:15 +00:00
matz 4ded52b623 * file.c (rb_get_path): get path string via "to_path" method if
path object is not a string. [Ruby2]

* gc.c (rb_gc_call_finalizer_at_exit): do not free threads in the
  exit finalizers.

* io.c (rb_io_reopen): should use rb_io_check_io().


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@6114 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2004-04-07 02:51:05 +00:00
matz 919f456de8 * exception message clean-up by Ian Macdonald <ian@caliban.org>.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@6044 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2004-03-29 07:54:38 +00:00
nobu 90d8cbb1ee * file.c (rb_stat_mode): should not sign-expand, so backout.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@5622 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2004-02-04 13:39:49 +00:00
akr 40f9219a8b * file.c (test_l): fix wrong method name in document.
(test_S): ditto.
  (test_b): ditto.
  (test_c): ditto.
  (test_suid): ditto.
  (test_sgid): ditto.
  (test_sticky): ditto.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@5620 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2004-02-03 17:20:08 +00:00
siena 357d0ffc29 * configure.in: check availability of link(). [ruby-dev:22237]
* file.c (rb_file_s_link): raise an exception when link() is unavailable.
* missing/os2.c (link): removed. File#link isn't supported.
* bcc32/Makefile.sub: define HAVE_LINK to enable link(). [ruby-dev:22241]
* win32/Makefile.sub: ditto.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@5532 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2004-01-21 16:09:40 +00:00
siena fc69b2a7f6 * defines.h: define RUBY_MBCHAR_MAX instead of MB_CUR_MAX.
* dir.c (Next, emx_mblen): use RUBY_MBCHAR_MAX for mblen().
* file.c (CharNext): ditto.
* ruby.c (translate_char): ditto.
* util.c (__crt0_glob_function): ditto.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@5530 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2004-01-21 15:26:11 +00:00
nobu 224021104d * ext/digest/defs.h, win32/win3.c, win32/win32.h, file.c: remove
useless casts for Borland C.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@5502 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2004-01-19 12:28:14 +00:00
matz 22c005569b * variable.c (rb_set_class_path): do not set path if
* lib/cgi.rb (CGI::QueryExtension): give extended string, not a
  delegater object.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@5501 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2004-01-19 09:19:31 +00:00
nobu a7b1a2eced * class.c, error.c, file.c, io.c, numeric.c, object.c, re.c, struct.c,
time.c: marked init_copy functions nodoc.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@5492 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2004-01-18 14:16:47 +00:00
matz 6c862db688 * file.c (test_wr): Rdoc fix. [ruby-core:02225]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@5450 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2004-01-12 16:26:05 +00:00
matz a739d26d0a * file.c (test_wr, test_ww): New functions implementing new
methods (File::world_readable?, File::world_writable?).

* file.c (S_IRUGO, S_IGUGO): New macros.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@5445 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2004-01-12 13:34:26 +00:00
matz 65d37c6cc5 * stable version 1.8.1 released.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@5284 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-12-24 15:19:11 +00:00
dave da99e407fb Add file.c comments (and necessary support in parse_c.rb)
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@5234 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-12-21 07:28:54 +00:00
nobu 5fd915fc83 * file.c: renamed and externalized rb_path_next,
rb_path_skip_prefix, rb_path_last_separator, rb_path_end.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@5194 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-12-15 04:32:23 +00:00
nobu 12b5b81a97 * dir.c (check_dirname): check string safety and remove extraneous
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: svn+ssh://ci.ruby-lang.org/ruby/trunk@5191 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-12-15 04:07:03 +00:00
nobu faab8f264d * configure.in (ieeefp.h), numeric.c: needed for finite() on
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: svn+ssh://ci.ruby-lang.org/ruby/trunk@5163 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-12-11 02:39:59 +00:00
matz 5eaf7e5816 * gc.c (gc_mark): explicitly check mark recursion levels, instead
of unreliable stack length.

* file.c (path_check_1): honor sticky bits always.
  [ruby-talk:86273]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@5057 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-11-28 14:23:33 +00:00
matz 6212cfb9c5 * gc.c (Init_stack): stack region is far smaller than usual if
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: svn+ssh://ci.ruby-lang.org/ruby/trunk@5002 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-11-22 04:00:03 +00:00
matz a4934a42cb * io.c (read_all): fptr->f may be NULL, if IO is closed in the
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: svn+ssh://ci.ruby-lang.org/ruby/trunk@4892 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-11-04 09:13:57 +00:00
matz befb570536 * hash.c (rb_hash_each): Hash#each should yield single value.
[ruby-talk:84420]

* hash.c (env_each): ditto for ENV.each.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@4839 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-10-24 14:31:14 +00:00
matz 06d9340f2e * eval.c (ruby_cleanup): call finalizers and exit procs before
terminating threads.

* eval.c (ruby_cleanup): preserve ruby_errinfo before ruby_finalize_0().


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@4826 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-10-21 14:42:15 +00:00
matz 9942c6ed13 * file.c (rb_file_s_expand_path): avoid calling rb_scan_args() for
apparent cases. [ruby-talk:79748]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@4439 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-08-23 17:06:55 +00:00
nobu b8dfb46df7 BUFCHECK() doesn't update p/pend in loop.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@4437 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-08-23 16:06:25 +00:00
nobu 33c9c0005b * file.c (file_expand_path): performance improvement.
[ruby-talk:79748]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@4436 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-08-23 15:44:05 +00:00
nobu 625c1361e3 * configure.in (HUGE_ST_INO): check whether struct stat.st_ino
is larger than long.  [ruby-dev:21194]
  http://www.geocities.co.jp/SiliconValley-PaloAlto/1409/ruby/beos.html

* error.c (syserr_eqq): errno might exceed Fixnum limit.

* error.c (Init_Exception): moved base initialization from
  init_syserr().

* inits.c (rb_call_inits): postpone initializing errnos until
  Bignum is available.

* ext/curses/curses.c (_XOPEN_SOURCE_EXTENDED): needed to let
  keyname() and so on be declared.

* ext/curses/curses.c (curses_resizeterm, window_resize):
  arguments conflicted with macros in term.h.

* ext/curses/curses.c (Curses module methods): ensure
  initialized.  [ruby-dev:21191]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@4392 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-08-15 03:01:52 +00:00
nobu db8874aa1b * configure.in (os2-emx): renamed from os2_emx, add flags to
CFLAGS and LDFLAGS, and remove lib prefix.  [ruby-dev:20993]

* file.c (rb_file_s_rename): retry with removing new file on
  DOSISH.  [ruby-dev:21007]

* ext/socket/extconf.rb (sendmsg, recvmsg): check functions.

* ext/socket/socket.c (unix_send_io, unix_recv_io): raise
  NotImplementedError unless system calls are available.

* ext/socket/socket.c (sock_initialize): rename from sock_init()
  to get rid of conflict with OS/2 socket library.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@4221 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-07-30 00:32:03 +00:00
nobu a644c35a99 * file.c (Init_File): IO should include File::Const.
[ruby-dev:20964]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@4194 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-07-28 14:23:12 +00:00
matz 85911c410a * ext/socket/socket.c (tcp_s_gethostbyname): was using
uninitialized size_t value. [ruby-talk:76946]

* Minor cleanups.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@4156 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-07-25 05:36:55 +00:00
matz 5dd2b7102c * gcc -Wall clean-up.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@4151 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-07-24 18:33:50 +00:00
eban 528b6c3f64 * file.c (DOSISH): better Cygwin support.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@4126 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-07-23 14:09:52 +00:00
matz 2436525ed8 * string.c (rb_str_lstrip_bang): strip NUL along with white
spaces. [ruby-talk:76659]

* string.c (rb_str_rstrip_bang): ditto.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@4123 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-07-23 06:48:52 +00:00