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

179 Коммитов

Автор SHA1 Сообщение Дата
卜部昌平 7b6fde4258 drop-in type check for rb_define_module_function
We can check the function pointer passed to rb_define_module_function
like how we do so in rb_define_method.  The difference is that this
changeset reveales lots of atiry mismatches.
2019-08-29 18:34:09 +09:00
卜部昌平 703783324c rb_ensure now free from ANYARGS
After 5e86b005c0, I now think ANYARGS is
dangerous and should be extinct.  This commit deletes ANYARGS from
rb_ensure, which also revealed many arity / type mismatches.
2019-08-27 15:52:26 +09:00
Nobuyoshi Nakada 715955ff27
Include ruby/assert.h in ruby/ruby.h so that assertions can be there 2019-07-14 17:58:03 +09:00
Nobuyoshi Nakada 1d2ec4b216
Added Etc::VERSION 2019-07-10 12:33:29 +09:00
Nobuyoshi Nakada 612b7b6224
Removed unused files 2019-07-10 12:32:35 +09:00
Samuel Williams d17344cfc5 Remove IA64 support. 2019-06-19 23:30:04 +12:00
nobu 3d1c86a26f Removed moving toplevel header since r12501
Moving public headers was 12-years ago, no depend files would
expect ruby.h in the top source directory now.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67033 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2019-02-08 02:46:22 +00:00
hsbt e05e77fd6d Retry r65211.
* Maybe, RbConfig.ruby only provides after Ruby installation.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65224 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-10-20 10:30:42 +00:00
hsbt f16326fdda Revert "Mergr etc from github repository."
This reverts commit a852002779.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65220 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-10-20 10:05:05 +00:00
hsbt a852002779 Mergr etc from github repository.
* ext/etc/extconf.rb: It supports to generate dependency header
    on standalone gem with github repository.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65211 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-10-20 07:38:19 +00:00
hsbt 1f4796a182 Merge etc gemspec from github repository.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63509 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-05-28 00:42:32 +00:00
k0kubun 3406c5d613 Refactor ERB version checking for keyword arguments
Improving code like r62590. See r62529 for details.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62594 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-02-27 11:12:23 +00:00
k0kubun cc777d09f4 erb.rb: deprecate safe_level of ERB.new
Also, as it's in the middle of the list of 4 arguments, 3rd and 4th arguments
(trim_mode, eoutvar) are changed to keyword arguments.
Old ways to specify arguments are deprecated and warned now.

bin/erb: deprecate -S option.

We'll remove all of deprecated ones at Ruby 2.7+.

enc/make_encmake.rb: stopped using deprecated interface
ext/etc/mkconstants.rb: ditto
ext/socket/mkconstants.rb: ditto
sample/ripper/ruby2html.rb: ditto
spec/ruby/library/erb/defmethod/def_erb_method_spec.rb: ditto
spec/ruby/library/erb/new_spec.rb: ditto
test/erb/test_erb.rb: ditto
test/erb/test_erb_command.rb: ditto
tool/generic_erb.rb: ditto
tool/ruby_vm/helpers/dumper.rb: ditto
tool/transcode-tblgen.rb: ditto
lib/rdoc/erbio.rb: ditto
lib/rdoc/generator/darkfish.rb: ditto

[Feature #14256]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62529 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-02-22 13:28:25 +00:00
hsbt b9426859e7 Bump version to etc-1.0.0 as default gems.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61201 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-12-13 05:52:47 +00:00
stomar 0f7fed9253 etc.c: improve docs for sysconfdir
* ext/etc/etc.c: [DOC] small language fixes for etc_sysconfdir docs.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60704 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-11-07 20:08:34 +00:00
nobu 8fc8587e05 sysconfdir on Windows
* ext/etc/etc.c (etc_sysconfdir): mentioned special case on
  Windows.  [ruby-core:43110] [Bug #6121]

* ext/etc/extconf.rb: define SYSCONFDIR only if sysconfdir is set
  in RbConfig::CONFIG and not empty.

* win32/Makefile.sub (config.status): sysconfdir is not used on
  Windows.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60402 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-10-24 13:48:08 +00:00
naruse 1333c0f0df Revert "sysconfdir on Windows"
This reverts commit r60279.
This breaks mswin build:
https://ci.appveyor.com/project/ruby/ruby/build/1.0.5571

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60399 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-10-24 11:15:20 +00:00
nobu e4ff51b05a sysconfdir on Windows
* ext/etc/etc.c (etc_sysconfdir): mentioned special case on
  Windows.  [ruby-core:43110] [Bug #6121]

* win32/Makefile.sub (config.status): sysconfdir is not used on
  Windows.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60279 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-10-21 14:19:23 +00:00
nobu 1852b4a866 ext: check if null byte is contained
[ruby-dev:50267] [Bug #13953]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60071 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-09-30 08:35:23 +00:00
nobu 253fd5fe6b ext: adjust indent [ci skip]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60042 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-09-27 05:08:53 +00:00
hsbt 0a907a3792 Make string literal to frozen object on gemspec of defulte gems.
Added following gemspecs.

    * extensions: date, dbm, etc, fiddle, gdbm, sdbm, stringio, strscan, zlib
    * pure ruby libraries: cmath, csv, fileutils, scanf, webrick

  psych and rdoc is out of scope of this commit. I will merge after
  upstream was change to `frozen_string_literal: true`.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59115 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-06-19 13:03:06 +00:00
hsbt ffa55136c4 Merge upstream of ruby/etc.
* Do not use `git ls-files` for file listing.
  * Fix extconf.rb path.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58321 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-04-11 22:41:21 +00:00
hsbt 82993d5c9c Fix a typo.
Patch by @voxik. [fix GH-1581]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58316 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-04-11 12:19:05 +00:00
hsbt 83dc06601f Import gemspec from ruby/etc.
* Update configuraiton for gem release.
  * Bump version to 0.2.1. Because 0.2.0 is already reserved on rubygems.org

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58315 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-04-11 09:46:53 +00:00
shyouhei 20c72dc89d ruby tool/update-deps --fix
Onigumo 6 (r57045) introduced new onigumo.h header file, which is
required from quite much everywhere.  This commit adds necessary
dependencies.

Note: ruby/oniguruma.h now includes onigumo.h,
      ruby/io.h includes oniguruma.h,
      ruby/encoding.h also includes oniguruma.h,
      and internal.h includes encoding.h.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58054 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-03-22 06:00:18 +00:00
hsbt 55c13218d9 Added initial gemspec for Etc module.
[Feature #13256]

  * doc/*.rdoc: move Etc module to default gem section.
  * ext/etc/etc.gemspec: first gemspec.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57730 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-02-27 09:20:39 +00:00
kazu b9d8758e26 {ext,test}/etc: Specify frozen_string_literal: true.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57451 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-01-29 01:35:23 +00:00
nobu 64fea27496 Update dependencies
* common.mk (compile.o, loadpath.o): update dependencies.

* common.mk (vm_call.o): remove stale object dependencies.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55589 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-07-06 05:48:13 +00:00
nobu c3262bceee etc.c: retry with allocated string buffer
* ext/etc/etc.c (etc_systmpdir): retry with allocated string
  buffer if static buffer size is not enough.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55262 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-06-02 12:21:42 +00:00
naruse c4fdfabcc8 handle ext/ as r53141
g -L frozen_string_literal ext/**/*.rb|xargs ruby -Ka -e'ARGV.each{|fn|puts
fn;open(fn,"r+"){|f|s=f.read.sub(/\A(#!.*\n)?(#.*coding.*\n)?/,"\\&#
frozen_string_literal: false\n");f.rewind;f.write s}}'

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53143 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-12-16 05:31:54 +00:00
nobu 038c0e5a80 ext: suppress warnings
* ext/{etc,openssl,tk}: Adding parens and comparisons around
  assignments to get rid of Wparentheses warnings.  [Fix GH-875]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50346 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-04-19 03:19:20 +00:00
nobu 6ccf3d68c2 win32.c: login name encoding
* ext/etc/etc.c (etc_getlogin): set login name encoding properly.
  [ruby-core:66163] [Bug #10493]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48360 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-11-10 08:24:36 +00:00
kosaki 2f438d6010 * ext/etc/etc.c (etc_nprocessors_affin): maximum "n" should be 16384.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48082 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-10-21 18:48:03 +00:00
kosaki dfe56d3662 * ext/etc/etc.c (etc_nprocessors_affin): minor spell fix.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48081 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-10-21 18:46:46 +00:00
kosaki 0fa75e813e * ext/etc/etc.c (etc_nprocessors_affin): optimize memory usege a
bit. Typical rubyist never use 8k cpus machine.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48080 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-10-21 18:46:33 +00:00
akr f65a15b0cf update doc.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47965 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-10-15 23:12:21 +00:00
akr 0621ddc423 * ext/etc/etc.c (etc_nprocessors_affin): Test CPU_ALLOC availability.
CentOS 5 don't have CPU_ALLOC().



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47943 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-10-15 13:09:23 +00:00
akr 7d9e04de49 * ext/etc/etc.c (etc_nprocessors_affinity): use sched_getaffinity
for getting precious number of available cpus.

* ext/etc/etc.c (etc_nprocessors): use etc_nprocessors_affinity if
  possible.

  [Feature #10267] etc-nprocessors-kosaki2.patch



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47939 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-10-15 09:41:25 +00:00
normal 7fcf57412a ext/etc/etc.c (etc_systmpdir): set default tmplen correctly
Fixup r47826.

This fixes the following test failure for me:
TestRequire#test_tainted_loadpath [test/ruby/test_require.rb:331]:
SecurityError expected but nothing was raised.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47841 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-10-07 20:25:07 +00:00
nobu f18065f469 etc.c: try confstr on Mac OS X
* ext/etc/etc.c (etc_systmpdir): try user temporary directory by
  confstr() on Mac OS X.
  c.f. http://www.opensource.apple.com/source/ruby/ruby-104/patches/ext_etc_etc.c.diff

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47826 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-10-07 02:17:10 +00:00
akr 9deb5262d8 update doc.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47803 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-10-05 14:44:18 +00:00
usa 56fa18c9d3 * ext/etc/etc.c (etc_nprocessors): Windows support.
see [Feature #10267]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47764 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-10-02 09:42:23 +00:00
akr 7b25bd8ba2 * ext/etc/etc.c (etc_nprocessors): New method.
Accepted by matz at RubyKaigi 2014.
  [ruby-core:65142] [Feature #10267]



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47761 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-10-02 03:23:26 +00:00
nobu 24e4104675 mkconstants.rb: remove empty comments
* ext/etc/mkconstants.rb: remove empty comments, defaut_proc isn't
  called by accessing nil-assigned elements, and the same content
  is useless.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46712 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-07-06 02:42:55 +00:00
nobu e877835700 ext/etc: distclean
* ext/etc/extconf.rb: clean constdefs.h at distclean.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46703 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-07-05 05:32:25 +00:00
nobu 172f3673ad etc.c: fix typo
* ext/etc/etc.c (etc_uname): fix typo, `len` with `plen`, and an
  extra semicolon.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46020 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-05-19 12:35:22 +00:00
nobu e3653bfe6f etc.c: old VC
* ext/etc/etc.c (etc_uname): fix for old VC.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46019 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-05-19 12:32:25 +00:00
nobu 21190be21c etc.c: fix parameter
* ext/etc/etc.c (etc_uname): call with same first parameters.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46018 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-05-19 12:32:14 +00:00
nobu 82dbd0970c etc.c: Etc.uname on Windows
* ext/etc/etc.c (etc_uname): add support for Windows using
  GetVersionExW(), GetSystemInfo(), and GetComputerNameExW() with
  `ComputerNameDnsHostname`.  [Feature #9842]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46014 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-05-19 07:54:25 +00:00
akr 0b373d6bbb [DOC]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46000 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-05-18 08:45:07 +00:00
akr db1d53450e Fix a dependency for etc.o.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45988 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-05-18 03:04:07 +00:00
akr 4f3432f9cb [DOC]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45985 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-05-18 02:06:15 +00:00
akr ea1a4f2929 * ext/etc/etc.c: Etc.sysconf, Etc.confstr and IO#pathconf implemented.
* ext/etc/extconf.rb: Check sysconf(), confstr() and fpathconf().

* ext/etc/mkconstants.rb: New file.

 [ruby-core:62600] [Feature #9842]



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45984 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-05-18 01:48:47 +00:00
akr 63a23dc678 * ext/etc/etc.c: Etc.uname method implemented.
* ext/etc/extconf.rb: Check uname() function.

  [ruby-core:62139] [Feature #9770]



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45983 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-05-18 00:58:34 +00:00
akr 708e1bd49d * ext/etc/extconf.rb: Build ext/etc unconditionally.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45692 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-04-23 11:53:07 +00:00
nobu 4c00941411 etc.c: encodings
* ext/etc/etc.c (setup_passwd, setup_group): set proper encodings to
  string members.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42349 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-08-03 00:46:10 +00:00
nobu 042e5013a3 struct.c: rb_struct_define_under
* struct.c (rb_struct_define_under): new function to define Struct
  under the given namespace, not under Struct.  [Feature #8264]
* ext/etc/etc.c: use rb_struct_define_under.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42348 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-08-03 00:31:02 +00:00
charliesome 98fec7b4a2 * ext/etc/etc.c (setup_passwd): revert r41560, unnecessary
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41563 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-06-22 06:26:32 +00:00
charliesome 3f236ce7ba * ext/etc/etc.c (Init_etc): omit 'passwd' from definition of Etc::Passwd
if HAVE_STRUCT_PASSWD_PW_PASSWD is not defined to prevent mismatch of
  fields and values in setup_passwd

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41562 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-06-22 05:43:08 +00:00
charliesome 1a2c400273 * ext/etc/etc.c (setup_passwd): pass 0 as VALUE to rb_struct_new to
prevent segfault if the compiler passes it as a 32 bit integer on
  a 64 bit ruby

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41560 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-06-22 05:35:23 +00:00
charliesome ff0e82ed9d * ext/etc/etc.c (etc_getpwnam): use PRIsVALUE in format string instead
of %s and RSTRING_PTR

* ext/etc/etc.c (etc_getgrnam): ditto

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41558 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-06-22 04:46:47 +00:00
shugo 1f828497d1 * safe.c (rb_set_safe_level, safe_setter): raise an ArgumentError
when $SAFE is set to 4.  $SAFE=4 is now obsolete.
  [ruby-core:55222] [Feature #8468]

* object.c (rb_obj_untrusted, rb_obj_untrust, rb_obj_trust):
  Kernel#untrusted?, untrust, and trust are now deprecated.
  Their behavior is same as tainted?, taint, and untaint,
  respectively.

* include/ruby/ruby.h (OBJ_UNTRUSTED, OBJ_UNTRUST): OBJ_UNTRUSTED()
  and OBJ_UNTRUST() are aliases of OBJ_TAINTED() and OBJ_TAINT(),
  respectively.

* array.c, class.c, debug.c, dir.c, encoding.c, error.c, eval.c,
  ext/curses/curses.c, ext/dbm/dbm.c, ext/dl/cfunc.c,
  ext/dl/cptr.c, ext/dl/dl.c, ext/etc/etc.c, ext/fiddle/fiddle.c,
  ext/fiddle/pointer.c, ext/gdbm/gdbm.c, ext/readline/readline.c,
  ext/sdbm/init.c, ext/socket/ancdata.c, ext/socket/basicsocket.c,
  ext/socket/socket.c, ext/socket/udpsocket.c,
  ext/stringio/stringio.c, ext/syslog/syslog.c, ext/tk/tcltklib.c,
  ext/win32ole/win32ole.c, file.c, gc.c, hash.c, io.c, iseq.c,
  load.c, marshal.c, object.c, proc.c, process.c, random.c, re.c,
  safe.c, string.c, thread.c, transcode.c, variable.c,
  vm_insnhelper.c, vm_method.c, vm_trace.c: remove code for
  $SAFE=4.

* test/dl/test_dl2.rb, test/erb/test_erb.rb,
  test/readline/test_readline.rb,
  test/readline/test_readline_history.rb, test/ruby/test_alias.rb,
  test/ruby/test_array.rb, test/ruby/test_dir.rb,
  test/ruby/test_encoding.rb, test/ruby/test_env.rb,
  test/ruby/test_eval.rb, test/ruby/test_exception.rb,
  test/ruby/test_file_exhaustive.rb, test/ruby/test_hash.rb,
  test/ruby/test_io.rb, test/ruby/test_method.rb,
  test/ruby/test_module.rb, test/ruby/test_object.rb,
  test/ruby/test_pack.rb, test/ruby/test_rand.rb,
  test/ruby/test_regexp.rb, test/ruby/test_settracefunc.rb,
  test/ruby/test_struct.rb, test/ruby/test_thread.rb,
  test/ruby/test_time.rb: remove tests for $SAFE=4.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41259 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-06-12 14:20:51 +00:00
akr bfb334eefa * file.c, ext/etc/etc.c, ext/socket/unixsocket.c,
ext/openssl/ossl.h, ext/openssl/openssl_missing.c: Use
  HAVE_AGGREGATE_MEMBER instead of HAVE_ST_MEMBER.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40625 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-05-09 12:12:17 +00:00
akr b47138580c * lib/mkmf.rb: Add ruby/ruby.h, ruby/missing.h, ruby/intern.h,
ruby/st.h and ruby/subst.h for ruby_headers in generated Makefile.

* ext/-test-/old_thread_select/depend: Update dependencies.

* ext/-test-/wait_for_single_fd/depend: Ditto.

* ext/bigdecimal/depend: Ditto.

* ext/curses/depend: Ditto.

* ext/digest/bubblebabble/depend: Ditto.

* ext/digest/depend: Ditto.

* ext/digest/md5/depend: Ditto.

* ext/digest/rmd160/depend: Ditto.

* ext/digest/sha1/depend: Ditto.

* ext/digest/sha2/depend: Ditto.

* ext/dl/callback/depend: Ditto.

* ext/dl/depend: Ditto.

* ext/etc/depend: Ditto.

* ext/nkf/depend: Ditto.

* ext/objspace/depend: Ditto.

* ext/pty/depend: Ditto.

* ext/readline/depend: Ditto.

* ext/ripper/depend: Ditto.

* ext/sdbm/depend: Ditto.

* ext/socket/depend: Ditto.

* ext/stringio/depend: Ditto.

* ext/strscan/depend: Ditto.

* ext/syslog/depend: Ditto.

* ext/-test-/num2int/depend: Removed.

* ext/dbm/depend: Ditto.

* ext/fcntl/depend: Ditto.

* ext/gdbm/depend: Ditto.

* ext/racc/cparse/depend: Ditto.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40268 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-04-13 00:46:29 +00:00
nobu 6e9c02515d * ext/etc/etc.c: fix struct name.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40266 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-04-12 15:23:22 +00:00
nobu 1e4b2f9bd1 etc.c: Etc namespace
* ext/etc/etc.c (Init_etc): move Passwd and Group under Etc namespace
  as primary names.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40264 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-04-12 15:16:00 +00:00
zzak a756aa75ea * doc/etc.rd: Removed stale documentation file
* ext/etc/etc.c:  Merged documentation from doc/etc.rd and updated
  rdoc, added documentation for Etc::Passwd and Etc::Group


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38258 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-12-07 07:08:06 +00:00
akr 23e7a4e285 * ext/etc/etc.c (passwd_ensure): move endpwent() call from
passwd_iterate to close /etc/passwd on exception.
  (group_ensure): move endgrent() call from group_iterate to close
  /etc/group on exception.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35635 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-05-13 14:00:16 +00:00
nobu 413f24d3b0 * whitespace cleanup.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33634 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-11-04 07:19:23 +00:00
drbrain 14f878aed6 * ext/etc/etc.c: Document Etc, Etc.sysconfdir, Etc.systmpdir. Patch
by mathew murphy.  [Ruby 1.9 - Bug #5396]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33393 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-10-03 23:33:57 +00:00
nobu 0d6d23b25d * ext: remove trailing spaces.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31689 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-05-22 09:26:02 +00:00
akr 08a4d1af3f * ext/etc/etc.c: parenthesize macro arguments.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30826 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-02-08 15:47:52 +00:00
nobu afd241f7ee * ext/etc/extconf.rb: use expanded sysconfdir with empty DESTDIR.
[ruby-core:32394]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29268 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-09-15 23:27:48 +00:00
nobu 9e39c618da * ext/etc/etc.c (etc_systmpdir): assume system default tmpdir
safe.  [ruby-dev:42089]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29209 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-09-09 22:29:16 +00:00
nobu c53664c84d .cvsignore: have not been used already. [Bug #3468]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28898 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-08-07 05:43:21 +00:00
nobu 2c01a07bf4 * ext/etc/etc.c (etc_systmpdir): moved from ext/tmpdir.
* ext/etc/etc.c (etc_sysconfdir): added.

* lib/rubygems/config_file.rb, lib/tmpdir.rb: use etc.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27667 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-05-08 03:25:17 +00:00
nobu 5512c9b287 * ext/etc/etc.c: suppressed warnings.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27666 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-05-08 03:08:53 +00:00
nobu 9e67f6ecec * doc/etc.rd, doc/etc.rd.ja: moved from ext/etc.
* ext/etc.c (Init_etc): fixed rdoc.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27454 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-04-23 05:07:38 +00:00
nobu 977267c2e0 * ext/**/*.[ch]: removed trailing spaces.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27437 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-04-22 08:04:13 +00:00
nobu 9f5f7b87ba * ext/etc/etc.c (etc_each_group): fixed typo.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25525 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-10-28 05:51:33 +00:00
nobu 875f969fd9 * ext/etc/etc.c (etc_getpwuid): use rb_uid_t. [ruby-dev:38443]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@23425 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-05-14 07:13:40 +00:00
nobu 22f1a984f1 * ext/etc/etc.c (etc_each_group): defines only when Etc::Group is
available.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22438 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-02-19 06:14:27 +00:00
nobu 47d55a02a3 * ext/etc/etc.c (Etc::Passwd.each, Etc::Group.each): new methods.
[ruby-dev:37999]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22377 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-02-17 15:55:49 +00:00
nobu 201eb37d92 * ext/etc/etc.c (sGroup): getgrent may not be available.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19946 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-10-26 09:07:37 +00:00
matz 350e6ed84b * ext/etc/etc.c (Init_etc): define constant aliases Etc::Passwd
and Etc::Group.  [ruby-dev:35150]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@17428 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-06-19 08:45:25 +00:00
nobu 3c48ebce0b * ext/etc/etc.c (etc_passwd, etc_group): fixed rdoc. a patch from
okkez <okkez000 AT gmail.com> in [ruby-dev:35141].


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@17395 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-06-18 01:18:13 +00:00
akr 6cdef2dc7e * $Date$ keyword removed to avoid inclusion of locale dependent
string.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14912 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-01-06 15:49:38 +00:00
matz fd618e2234 * ext/etc/etc.c (etc_getlogin): update documentation to note
security issue.  [ruby-Bugs-11821]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13284 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-08-27 10:15:18 +00:00
matz 33163ad123 * regparse.c, etc.: K&R to ANSI code cleanup patch from Stefan
Huehner <stefan at huehner.org>.  [ruby-core:10543]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12095 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-03-19 03:58:57 +00:00
nobu 9c79e14614 * ext/etc/etc.c (etc_getgrgid): missed to replace a macro.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@11776 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-02-18 13:56:15 +00:00
nobu 562f256c54 * configure.in (pid_t, uid_t, gid_t): check if defined.
* intern.h, process.c, rubyio.h, ext/etc/etc.c, ext/pty/pty.c: use
  rb_{pid,uid,gid}_t instead of plain int.  [ruby-dev:30376]

* ext/etc/extconf.rb (PIDT2NUM, NUM2PIDT, UIDT2NUM, NUM2UIDT, GIDT2NUM,
  NUM2GIDT): moved to configure.in.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@11770 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-02-18 04:13:09 +00:00
shyouhei 42b298560b r11523@ruby: shyouhei | 2007-01-09 15:57:58 +0900
* ext/etc/etc.c (etc_getpwuid, etc_getgrgid): fix to correctly
   convert uid/gid from VALUE.
 
 * ext/etc/etc.c (etc_getpwuid): ditto.
 


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@11521 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-01-09 11:52:26 +00:00
ko1 a3e1b1ce7e * Merge YARV
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@11439 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-12-31 15:02:22 +00:00
matz c35290824a * ext/etc/etc.c (etc_getpwuid): uid integer should be wraped in
uid_t value.  [ruby-core:08897]

* ext/etc/etc.c (etc_getpwuid): uid_t may be bigger than plain
  'int' type.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@10980 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-09-21 05:12:57 +00:00
matz 25c50cd193 * ruby.h (struct RString): embed small strings.
(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@10809 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-08-31 10:30:33 +00:00
nobu 3051dabd08 * ext/etc/extconf.rb (PW_UID2VAL, PW_GID2VAL): defaulted to conversion
from int, and sys/types.h needs to be included before grp.h.
  fixed: [ruby-dev:28938]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@10458 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-07-03 05:42:35 +00:00
nobu 6de2f53f98 * ext/etc/etc.c (setup_passwd, setup_group): allow bignum uid, gid and
so on.  [ruby-talk:199102]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@10408 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-06-27 02:37:01 +00:00
akr 934847fbeb add extconf.h to .cvsignore.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@10375 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-06-24 01:15:08 +00:00
matz 1b7465e893 * eval.c, file.c, etc.: code-cleanup patch from Stefan Huehner
<stefan at huehner.org>.  [ruby-core:08029]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@10351 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-06-20 18:02:17 +00:00
matz 9b383bd6cf * sprintf.c (rb_str_format): allow %c to print one character
string (e.g. ?x).

* lib/tempfile.rb (Tempfile::make_tmpname): put dot between
  basename and pid.  [ruby-talk:196272]
* parse.y (do_block): remove -> style block.

* parse.y (parser_yylex): remove tLAMBDA_ARG.

* eval.c (rb_call0): binding for the return event hook should have
  consistent scope.  [ruby-core:07928]

* eval.c (proc_invoke): return behavior should depend whether it
  is surrounded by a lambda or a mere block.

* eval.c (formal_assign): handles post splat arguments.

* eval.c (rb_call0): ditto.

* st.c (strhash): use FNV-1a hash.

* parse.y (parser_yylex): removed experimental ';;' terminator.

* eval.c (rb_node_arity): should be aware of post splat arguments.

* eval.c (rb_proc_arity): ditto.

* parse.y (f_args): syntax rule enhanced to support arguments
  after the splat.

* parse.y (block_param): ditto for block parameters.

* parse.y (f_post_arg): mandatory formal arguments after the splat
  argument.

* parse.y (new_args_gen): generate nodes for mandatory formal
  arguments after the splat argument.

* eval.c (rb_eval): dispatch mandatory formal arguments after the
  splat argument.

* parse.y (args): allow more than one splat in the argument list.

* parse.y (method_call): allow aref [] to accept all kind of
  method argument, including assocs, splat, and block argument.

* eval.c (SETUP_ARGS0): prepare block argument as well.

* lib/mathn.rb (Integer): remove Integer#gcd2. [ruby-core:07931]

* eval.c (error_line): print receivers true/false/nil specially.

* eval.c (rb_proc_yield): handles parameters in yield semantics.

* eval.c (nil_yield): gives LocalJumpError to denote no block
  error.

* io.c (rb_io_getc): now takes one-character string.

* string.c (rb_str_hash): use FNV-1a hash from Fowler/Noll/Vo
  hashing algorithm.

* string.c (rb_str_aref): str[0] now returns 1 character string,
  instead of a fixnum.	[Ruby2]

* parse.y (parser_yylex): ?c now returns 1 character string,
  instead of a fixnum.	[Ruby2]

* string.c (rb_str_aset): no longer support fixnum insertion.

* eval.c (umethod_bind): should not update original class.
  [ruby-dev:28636]

* eval.c (ev_const_get): should support constant access from
  within instance_eval().  [ruby-dev:28327]

* time.c (time_timeval): should round for usec floating
  number.  [ruby-core:07896]

* time.c (time_add): ditto.

* dir.c (sys_warning): should not call a vararg function
  rb_sys_warning() indirectly.	[ruby-core:07886]

* numeric.c (flo_divmod): the first element of Float#divmod should
  be an integer. [ruby-dev:28589]

* test/ruby/test_float.rb: add tests for divmod, div, modulo and remainder.

* re.c (rb_reg_initialize): should not allow modifying literal
  regexps.  frozen check moved from rb_reg_initialize_m as well.

* re.c (rb_reg_initialize): should not modify untainted objects in
  safe levels higher than 3.

* re.c (rb_memcmp): type change from char* to const void*.

* dir.c (dir_close): should not close untainted dir stream.

* dir.c (GetDIR): add tainted/frozen check for each dir operation.

* lib/rdoc/parsers/parse_rb.rb (RDoc::RubyParser::parse_symbol_arg):
  typo fixed.  a patch from Florian Gross <florg at florg.net>.

* eval.c (EXEC_EVENT_HOOK): trace_func may remove itself from
  event_hooks.	no guarantee for arbitrary hook deletion.
  [ruby-dev:28632]

* util.c (ruby_strtod): differ addition to minimize error.
  [ruby-dev:28619]

* util.c (ruby_strtod): should not raise ERANGE when the input
  string does not have any digits.  [ruby-dev:28629]

* eval.c (proc_invoke): should restore old ruby_frame->block.
  thanks to ts <decoux at moulon.inra.fr>.  [ruby-core:07833]
  also fix [ruby-dev:28614] as well.

* signal.c (trap): sig should be less then NSIG.  Coverity found
  this bug.  a patch from Kevin Tew <tewk at tewk.com>.
  [ruby-core:07823]

* math.c (math_log2): add new method inspired by
  [ruby-talk:191237].

* math.c (math_log): add optional base argument to Math::log().
  [ruby-talk:191308]

* ext/syck/emitter.c (syck_scan_scalar): avoid accessing
  uninitialized array element.	a patch from Pat Eyler
  <rubypate at gmail.com>.  [ruby-core:07809]

* array.c (rb_ary_fill): initialize local variables first.  a
  patch from Pat Eyler <rubypate at gmail.com>.	 [ruby-core:07810]

* ext/syck/yaml2byte.c (syck_yaml2byte_handler): need to free
  type_tag.  a patch from Pat Eyler <rubypate at gmail.com>.
  [ruby-core:07808]

* ext/socket/socket.c (make_hostent_internal): accept ai_family
  check from Sam Roberts <sroberts at uniserve.com>.
  [ruby-core:07691]

* util.c (ruby_strtod): should not cut off 18 digits for no
  reason.  [ruby-core:07796]

* array.c (rb_ary_fill): internalize local variable "beg" to
  pacify Coverity.  [ruby-core:07770]

* pack.c (pack_unpack): now supports CRLF newlines.  a patch from
  <tommy at tmtm.org>.	[ruby-dev:28601]

* applied code clean-up patch from Stefan Huehner
  <stefan at huehner.org>.  [ruby-core:07764]

* lib/jcode.rb (String::tr_s): should have translated non
  squeezing character sequence (i.e. a character) as well.  thanks
  to Hiroshi Ichikawa <gimite at gimite.ddo.jp> [ruby-list:42090]

* ext/socket/socket.c: document update patch from Sam Roberts
  <sroberts at uniserve.com>.  [ruby-core:07701]

* lib/mathn.rb (Integer): need not to remove gcd2.  a patch from
  NARUSE, Yui <naruse at airemix.com>.	[ruby-dev:28570]

* parse.y (arg): too much NEW_LIST()

* eval.c (SETUP_ARGS0): remove unnecessary access to nd_alen.

* eval.c (rb_eval): use ARGSCAT for NODE_OP_ASGN1.
  [ruby-dev:28585]

* parse.y (arg): use NODE_ARGSCAT for placeholder.

* lib/getoptlong.rb (GetoptLong::get): RDoc update patch from
  mathew <meta at pobox.com>.  [ruby-core:07738]

* variable.c (rb_const_set): raise error when no target klass is
  supplied.  [ruby-dev:28582]

* prec.c (prec_prec_f): documentation patch from
  <gerardo.santana at gmail.com>.  [ruby-core:07689]

* bignum.c (rb_big_pow): second operand may be too big even if
  it's a Fixnum.  [ruby-talk:187984]

* README.EXT: update symbol description.  [ruby-talk:188104]

* COPYING: explicitly note GPLv2.  [ruby-talk:187922]

* parse.y: remove some obsolete syntax rules (unparenthesized
  method calls in argument list).

* eval.c (rb_call0): insecure calling should be checked for non
  NODE_SCOPE method invocations too.

* eval.c (rb_alias): should preserve the current safe level as
  well as method definition.

* process.c (rb_f_sleep): remove RDoc description about SIGALRM
  which is not valid on the current implementation. [ruby-dev:28464]

 Thu Mar 23 21:40:47 2006  K.Kosako  <sndgk393 AT ybb.ne.jp>

* eval.c (method_missing): should support argument splat in
  super.  a bug in combination of super, splat and
  method_missing.  [ruby-talk:185438]

* configure.in: Solaris SunPro compiler -rapth patch from
  <kuwa at labs.fujitsu.com>.  [ruby-dev:28443]

* configure.in: remove enable_rpath=no for Solaris.
  [ruby-dev:28440]

* ext/win32ole/win32ole.c (ole_val2olevariantdata): change behavior
  of converting  OLE Variant object with VT_ARRAY|VT_UI1 and Ruby
  String object.

* ruby.1: a clarification patch from David Lutterkort
  <dlutter at redhat.com>.  [ruby-core:7508]

* lib/rdoc/ri/ri_paths.rb (RI::Paths): adding paths from rubygems
  directories.	a patch from Eric Hodel <drbrain at segment7.net>.
  [ruby-core:07423]

* eval.c (rb_clear_cache_by_class): clearing wrong cache.

* ext/extmk.rb: use :remove_destination to install extension libraries
  to avoid SEGV.  [ruby-dev:28417]

* eval.c (rb_thread_fd_writable): should not re-schedule output
  from KILLED thread (must be error printing).

* array.c (rb_ary_flatten_bang): allow specifying recursion
  level.  [ruby-talk:182170]

* array.c (rb_ary_flatten): ditto.

* gc.c (add_heap): a heap_slots may overflow.  a patch from Stefan
  Weil <weil at mail.berlios.de>.

* eval.c (rb_call): use separate cache for fcall/vcall
  invocation.

* eval.c (rb_eval): NODE_FCALL, NODE_VCALL can call local
  functions.

* eval.c (rb_mod_local): a new method to specify newly added
  visibility "local".

* eval.c (search_method): search for local methods which are
  visible only from the current class.

* class.c (rb_class_local_methods): a method to list local methods.

* object.c (Init_Object): add BasicObject class as a top level
  BlankSlate class.

* ruby.h (SYM2ID): should not cast to signed long.
  [ruby-core:07414]

* class.c (rb_include_module): allow module duplication.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@10235 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-06-09 21:20:17 +00:00