mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
revert r64957 [ci skip]
r64956 didn't work either... This means that svn.ruby-lang.org/ruby is not executing the latest git hook on git.ruby-lang.org/ruby-commit-hook. Tentatively I backported the changes of auto-style.rb in git.ruby-lang.org/ruby-commit-hook to git.ruby-lang.org/scripts. I hope this commit won't be rolled back by svn bot... git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64959 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
fcf308e5fc
commit
5d85a46e0c
1 changed files with 14 additions and 14 deletions
28
strftime.c
28
strftime.c
|
@ -226,8 +226,8 @@ format_value(VALUE val, int base)
|
||||||
*/
|
*/
|
||||||
static VALUE
|
static VALUE
|
||||||
rb_strftime_with_timespec(VALUE ftime, const char *format, size_t format_len,
|
rb_strftime_with_timespec(VALUE ftime, const char *format, size_t format_len,
|
||||||
rb_encoding *enc, VALUE time, const struct vtm *vtm,
|
rb_encoding *enc, VALUE time, const struct vtm *vtm,
|
||||||
VALUE timev, struct timespec *ts, int gmt, size_t maxsize)
|
VALUE timev, struct timespec *ts, int gmt, size_t maxsize)
|
||||||
{
|
{
|
||||||
size_t len = RSTRING_LEN(ftime);
|
size_t len = RSTRING_LEN(ftime);
|
||||||
char *s = RSTRING_PTR(ftime);
|
char *s = RSTRING_PTR(ftime);
|
||||||
|
@ -246,7 +246,7 @@ rb_strftime_with_timespec(VALUE ftime, const char *format, size_t format_len,
|
||||||
#ifdef MAILHEADER_EXT
|
#ifdef MAILHEADER_EXT
|
||||||
int sign;
|
int sign;
|
||||||
#endif
|
#endif
|
||||||
VALUE zone = Qnil;
|
VALUE zone = Qnil;
|
||||||
|
|
||||||
/* various tables, useful in North America */
|
/* various tables, useful in North America */
|
||||||
static const char days_l[][10] = {
|
static const char days_l[][10] = {
|
||||||
|
@ -318,7 +318,7 @@ rb_strftime_with_timespec(VALUE ftime, const char *format, size_t format_len,
|
||||||
len = s - start; \
|
len = s - start; \
|
||||||
rb_str_set_len(ftime, len); \
|
rb_str_set_len(ftime, len); \
|
||||||
if (!rb_strftime_with_timespec(ftime, (fmt), rb_strlen_lit(fmt), \
|
if (!rb_strftime_with_timespec(ftime, (fmt), rb_strlen_lit(fmt), \
|
||||||
enc, time, vtm, timev, ts, gmt, maxsize)) \
|
enc, time, vtm, timev, ts, gmt, maxsize)) \
|
||||||
return 0; \
|
return 0; \
|
||||||
s = RSTRING_PTR(ftime); \
|
s = RSTRING_PTR(ftime); \
|
||||||
i = RSTRING_LEN(ftime) - len; \
|
i = RSTRING_LEN(ftime) - len; \
|
||||||
|
@ -624,10 +624,10 @@ rb_strftime_with_timespec(VALUE ftime, const char *format, size_t format_len,
|
||||||
i = 0;
|
i = 0;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
if (NIL_P(zone)) {
|
if (NIL_P(zone)) {
|
||||||
zone = rb_time_zone_abbreviation(vtm->zone, time);
|
zone = rb_time_zone_abbreviation(vtm->zone, time);
|
||||||
}
|
}
|
||||||
tp = RSTRING_PTR(zone);
|
tp = RSTRING_PTR(zone);
|
||||||
if (enc) {
|
if (enc) {
|
||||||
for (i = 0; i < TBUFSIZE && tp[i]; i++) {
|
for (i = 0; i < TBUFSIZE && tp[i]; i++) {
|
||||||
if ((unsigned char)tp[i] > 0x7F) {
|
if ((unsigned char)tp[i] > 0x7F) {
|
||||||
|
@ -917,33 +917,33 @@ strftime_size_limit(size_t format_len)
|
||||||
|
|
||||||
VALUE
|
VALUE
|
||||||
rb_strftime(const char *format, size_t format_len, rb_encoding *enc,
|
rb_strftime(const char *format, size_t format_len, rb_encoding *enc,
|
||||||
VALUE time, const struct vtm *vtm, VALUE timev, int gmt)
|
VALUE time, const struct vtm *vtm, VALUE timev, int gmt)
|
||||||
{
|
{
|
||||||
VALUE result = rb_enc_str_new(0, 0, enc);
|
VALUE result = rb_enc_str_new(0, 0, enc);
|
||||||
return rb_strftime_with_timespec(result, format, format_len, enc,
|
return rb_strftime_with_timespec(result, format, format_len, enc,
|
||||||
time, vtm, timev, NULL, gmt,
|
time, vtm, timev, NULL, gmt,
|
||||||
strftime_size_limit(format_len));
|
strftime_size_limit(format_len));
|
||||||
}
|
}
|
||||||
|
|
||||||
VALUE
|
VALUE
|
||||||
rb_strftime_timespec(const char *format, size_t format_len, rb_encoding *enc,
|
rb_strftime_timespec(const char *format, size_t format_len, rb_encoding *enc,
|
||||||
VALUE time, const struct vtm *vtm, struct timespec *ts, int gmt)
|
VALUE time, const struct vtm *vtm, struct timespec *ts, int gmt)
|
||||||
{
|
{
|
||||||
VALUE result = rb_enc_str_new(0, 0, enc);
|
VALUE result = rb_enc_str_new(0, 0, enc);
|
||||||
return rb_strftime_with_timespec(result, format, format_len, enc,
|
return rb_strftime_with_timespec(result, format, format_len, enc,
|
||||||
time, vtm, Qnil, ts, gmt,
|
time, vtm, Qnil, ts, gmt,
|
||||||
strftime_size_limit(format_len));
|
strftime_size_limit(format_len));
|
||||||
}
|
}
|
||||||
|
|
||||||
#if 0
|
#if 0
|
||||||
VALUE
|
VALUE
|
||||||
rb_strftime_limit(const char *format, size_t format_len, rb_encoding *enc,
|
rb_strftime_limit(const char *format, size_t format_len, rb_encoding *enc,
|
||||||
VALUE time, const struct vtm *vtm, struct timespec *ts,
|
VALUE time, const struct vtm *vtm, struct timespec *ts,
|
||||||
int gmt, size_t maxsize)
|
int gmt, size_t maxsize)
|
||||||
{
|
{
|
||||||
VALUE result = rb_enc_str_new(0, 0, enc);
|
VALUE result = rb_enc_str_new(0, 0, enc);
|
||||||
return rb_strftime_with_timespec(result, format, format_len, enc,
|
return rb_strftime_with_timespec(result, format, format_len, enc,
|
||||||
time, vtm, Qnil, ts, gmt, maxsize);
|
time, vtm, Qnil, ts, gmt, maxsize);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue