aboutsummaryrefslogtreecommitdiffstats
path: root/sprintf.c
Commit message (Collapse)AuthorAgeFilesLines
...
* rb_str_format: check overflownobu2012-04-101-4/+14
| | | | | | * sprintf.c (rb_str_format): check overflow at too long name. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35279 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * sprintf.c (rb_enc_vsprintf): relaxed the restriction. since thenobu2012-01-141-2/+3
| | | | | | | | implementation deeply depends on plain char, so wchar_t based encodings are not supported. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34300 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * sprintf.c (rb_enc_vsprintf): can be used for ASCII compatiblenobu2012-01-131-1/+7
| | | | | | | encodings only. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34295 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * sprintf.c (rb_str_format): add RB_GC_GUARD to prevent temporarynagachika2011-08-221-2/+6
| | | | | | strings from GC. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33021 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * random.c (random_rand): remove unused variables.naruse2011-04-251-5/+2
| | | | | | | | | | | | | | * struct.c (rb_struct_define_without_accessor): ditto. * strftime.c (rb_strftime_with_timespec): ditto. * sprintf.c: ditto. * time.c (time_asctime): remove useless GetTimeval(). * thread_pthread.c: cast to (void *) for %p. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31343 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * sprintf.c: parenthesize macro arguments.akr2010-12-301-12/+12
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30426 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * sprintf.c (_HAVE_SANE_QUAD_): Don't forget LP64, r30156.naruse2010-12-101-4/+4
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30157 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * sprintf.c (_HAVE_SANE_QUAD_): if a certain platform has LONG_LONG inusa2010-12-101-0/+4
| | | | | | | 8 byte, it might be sane quad. [ruby-core:33634] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30156 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Revert "* sprintf.c (rb_str_format): fix: sprintf with hex format and"naruse2010-10-151-5/+7
| | | | | | | This reverts commit a160986d90cf90a86e01d60eddb04ffe0e584c36. Revert wrong commit. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29504 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * sprintf.c (rb_str_format): fix: sprintf with hex format andnaruse2010-10-151-7/+5
| | | | | | precision includes wrong dots. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29502 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * sprintf.c (rb_f_sprintf): fix rdoc. pointed out by Tomoyukinobu2010-09-151-2/+2
| | | | | | | Chikanaga at [ruby-core:32395], and a patch from Daniel Bovensiepen at [ruby-core:32403]. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29269 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * string.c (rb_str_times): mentioned about Hash argument. a patchnobu2010-09-141-3/+3
| | | | | | | | | | from Daniel Bovensiepen at [ruby-core:32386]. * sprintf.c (get_hash): ditto, and fix typo. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29254 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * sprintf.c: add short documentation about named reference.naruse2010-07-211-0/+9
| | | | | | [ruby-core:31294] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28702 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * util.c (ruby_hdtoa): renamed from BSD__hdtoa.nobu2010-07-211-0/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28696 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * array.c: Documentation: change => in call-seq to ->.marcandre2010-05-171-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Harmonize "#=>" in examples. [ruby-core:30206] * bignum.c: ditto * class.c: ditto * compar.c: ditto * cont.c: ditto * dir.c: ditto * encoding.c: ditto * enum.c: ditto * enumerator.c: ditto * error.c: ditto * eval.c: ditto * file.c: ditto * gc.c: ditto * io.c: ditto * load.c: ditto * marshal.c: ditto * math.c: ditto * numeric.c: ditto * object.c: ditto * pack.c: ditto * proc.c: ditto * process.c: ditto * random.c: ditto * range.c: ditto * re.c: ditto * ruby.c: ditto * signal.c: ditto * sprintf.c: ditto * string.c: ditto * struct.c: ditto * thread.c: ditto * time.c: ditto * transcode.c: ditto * variable.c: ditto * vm_eval.c: ditto * vm_method.c: ditto git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27865 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * include/ruby/ruby.h: replace snprintf and vsnprintf bynaruse2010-04-041-2/+1
| | | | | | | | | | | | | | | | | | | | ruby_snprintf and ruby_vsnprintf. [ruby-dev:40909] * configure.in: don't check snprintf(3) and vsnprintf(3). * include/ruby/missing.h: don't delare snprintf and vsnprintf. * include/ruby/ruby.h: include stdarg.h. * sprintf.c: include vsnprintf.c * vsnprintf.c: renamed from missing/vsnprintf.c. * vsnprintf.c: remove useless ifdefs. * win32/mkexports.rb: use ruby_snprintf and ruby_vsnprintf. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27214 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * sprintf.c (rb_str_format): support %a format. [ruby-dev:40650]naruse2010-04-011-5/+11
| | | | | | | | | | | | | * missing/vsnprintf.c (BSD_vfprintf): ditto. * missing/vsnprintf.c (cvt): ditto. * util.c (BSD__hdtoa): added. This is 2-clause BSDL licensed by David Schultz and from FreeBSD. * LEGAL: add about hdtoa() in util.c. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27141 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * io.c (rb_io_getline_fast): wrong calculation of new positionmatz2010-02-081-2/+2
| | | | | | | | | | from rb_str_coderange_scan_restartable(). [ruby-core:28103] * io.c (read_all): ditto. * sprintf.c (rb_str_format): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26622 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * sprintf.c: fixed type.nobu2009-09-231-7/+8
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25052 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* revert r24507. [ruby-dev:39073]matz2009-08-131-1/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24519 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * sprintf.c (rb_str_format): should preserve format encodingmatz2009-08-111-5/+5
| | | | | | before raising CompatibilityError. [ruby-list:46274] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24507 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * encoding.c (rb_enc_codepoint_len): combine rb_enc_codepoint()matz2009-05-191-2/+2
| | | | | | | | | | | | | | | | | | | and rb_enc_codelen() in one function to reduce calls. * encoding.c (rb_enc_codepoint): compatibility function. * sprintf.c (rb_str_format): use rb_enc_codepoint_len(). * string.c (rb_str_inspect, rb_str_upcase_bang, rb_str_downcase_bang, rb_str_capitalize_bang, rb_str_swapcase_bang, trnext, tr_trans, rb_str_delete_bang, rb_str_squeeze_bang, rb_str_count, rb_str_split_m, rb_str_each_line, rb_str_each_codepoint, rb_str_lstrip_bang, sym_printable): ditto. * transcode.c (make_econv_exception): use rb_enc_mbc_to_codepoint() git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@23493 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * sprintf.c (rb_str_format): scan coderange incrementally.nobu2009-04-131-0/+16
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@23188 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * sprintf.c (rb_str_format): optimize previous commit.naruse2009-04-131-1/+2
| | | | | | [ruby-list:45954] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@23187 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * sprintf.c (rb_str_format): check encoding compatibility only onnaruse2009-04-131-1/+1
| | | | | | real parts. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@23186 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * sprintf.c (rb_str_format): checks if named argument given twice.nobu2009-03-271-6/+14
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@23090 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * sprintf.c (GETNAMEARG): remembers named arg is used, to get ridnobu2009-03-271-1/+1
| | | | | | | of too many arguments warning. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@23089 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * dir.c, dln.c, parse.y, re.c, ruby.c, sprintf.c, strftime.c,nobu2009-03-171-3/+3
| | | | | | | | string.c, util.c, variable.c: use strlcpy, memcpy and snprintf instead of strcpy, strncpy and sprintf. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22984 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* stripped trailing spaces.nobu2009-02-221-11/+11
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22552 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * include/ruby/missing.h, sprintf.c: get rid of a warning of VC++.usa2009-01-021-6/+0
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@21277 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * sprintf.c: not force to override snprintf/vsnprintf.nobu2008-12-281-3/+0
| | | | | | | [ruby-core:20824] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@21115 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * sprintf.c (rb_str_format): fix buffer overflow.mame2008-12-221-2/+2
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@20921 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * configure.in (mingw): no longer uses snprintf and vsnprintf ofnobu2008-12-221-11/+20
| | | | | | | | | | | | | | | | | | msvcrt. * win32/win32.c (rb_w32_vsnprintf, rb_w32_snprintf): removed. * win32/Makefile.sub (config.h): vsnprintf exists in VC7 or later. * win32/mkexports.rb (Exports#initialize): aliases rb_w32_vsnprintf and rb_w32_snprintf for binary compatibility. * sprintf.c (rb_str_format): uses snprintf instead of sprintf. * numeric.c (flo_to_s, rb_num2long, rb_num2ll): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@20909 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * util.c (freedtoa): made static to get rid of name clash. a patch bynobu2008-10-241-1/+1
| | | | | | | | | Tadashi Saito <shiba AT mail2.accsnet.ne.jp> at [ruby-dev:36913] * util.c (ruby_dtoa): added prefix, ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19927 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * sprintf.c (rb_str_format): check if codepoint for %c is valid.nobu2008-10-091-1/+1
| | | | | | | [ruby-dev:36691] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19737 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * sprintf.c (rb_str_format): add %<name>s style named argumentmatz2008-09-301-1/+48
| | | | | | | | | | | | | | | support. a patch from Yusuke Endoh <mame at tsg.ne.jp> in [ruby-dev:35851]. * sprintf.c (rb_str_format): add gettext style named format (%{name}) support. inspired by [ruby-dev:35852]. * sprintf.c (GETNAMEARG): should raise KeyError exception when no named argument found. * hash.c (rb_hash_fetch): export fetch function. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19641 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * include/ruby/oniguruma.h (OnigCodePoint): unsigned long to unsigned int.naruse2008-09-111-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * include/ruby/encoding.h (rb_enc_codepoint): ditto. * encoding.c (rb_enc_codepoint): signed int to unsigned int. * encoding.c (rb_enc_ascget): ditto. * string.c (rb_str_casecmp): ditto. * string.c (enc_succ_alnum_char): ditto. * string.c (rb_str_inspect): ditto. * string.c (rb_str_upcase_bang): ditto. * string.c (rb_str_downcase_bang): ditto. * string.c (rb_str_capitalize_bang): ditto. * string.c (rb_str_swapcase_bang): ditto. * string.c (struct tr): ditto. * string.c (trnext): ditto. * string.c (tr_trans): ditto. * string.c (tr_setup_table): ditto. * string.c (tr_find): ditto. * string.c (rb_str_delete_bang): ditto. * string.c (rb_str_squeeze_bang): ditto. * string.c (rb_str_count): ditto. * string.c (rb_str_split_m): ditto. * string.c (rb_str_each_line): ditto. * string.c (rb_str_lstrip_bang): ditto. * string.c (rb_str_rstrip_bang): ditto. * string.c (rb_str_intern): ditto. * dir.c (char_casecmp): ditto. * sprintf.c (rb_str_format): ditto. * enc/emacs_mule.c (mbc_to_code): to be 32bit clean. * enc/emacs_mule.c (code_to_mbc): ditto. * enc/gb18030.c (mbc_to_code): ditto. * enc/gb18030.c (code_to_mbc): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19295 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * sprintf.c, util.c (quorem, nrv_alloc, dtoa): enabled floating pointnobu2008-08-121-0/+2
| | | | | | | support. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18522 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * include/ruby/intern.h, sprintf.c (rb_str_catf, rb_str_vcatf): newnobu2008-07-221-0/+35
| | | | | | | | | functions. [ruby-dev:35597] * string.c (rb_str_capacity): new function to return the capacity. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18156 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * missing/vsnprintf.c (struct __sbuf, FILE): use size_t.nobu2008-07-211-1/+1
| | | | | | | * sprintf.c (ruby__sfvwrite): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18142 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * sprintf.c: include ieeefp.h to refer isinf.mame2008-07-021-0/+4
| | | | | | | | | | | * ext/bigdecimal/bigdecimal.c: ditto. * ext/json/ext/generator/generator.c: ditto. * rational.c: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@17824 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * eval.c (rb_interrupt): trick to suppress GCC warning.shyouhei2008-07-011-2/+2
| | | | | | | * sprintf.c (rb_str_format): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@17777 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* describe %% in rdoc.akr2008-06-101-0/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@17086 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* update sprintf rdoc.akr2008-04-201-59/+62
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@16100 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* fix doc.akr2008-03-091-1/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15734 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* update sprintf rdoc.akr2008-03-071-49/+164
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15722 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* update sprintf rdoc.akr2008-03-061-30/+60
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15721 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * sprintf.c (rb_str_format): space flag is in effect for Inf/NaN too.nobu2008-03-061-0/+2
| | | | | | | [ruby-dev:34002] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15720 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * sprintf.c (rb_str_format): casting double to long is undefinedusa2008-03-061-2/+1
| | | | | | | | | if the interger part of double is out of the range of long. (fix previous commit). git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15716 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * sprintf.c (rb_str_format): casting double to long is undefinedusa2008-03-061-1/+2
| | | | | | | | if the interger part of double is out of the range of long. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15713 b2dd03c8-39d4-4d8f-98ff-823fe69b080e