Project

General

Profile

Bug #5213 » date_parse.c.2.patch

nagachika (Tomoyuki Chikanaga), 08/23/2011 12:28 PM

View differences:

ext/date/date_parse.c
dl = RSTRING_LEN(str) - (sizeof DST - 1);
ds = RSTRING_PTR(str) + dl;
if (strcmp(ss, STD) == 0) {
if (sl >= 0 && strcmp(ss, STD) == 0) {
str = rb_str_new(RSTRING_PTR(str), sl);
}
else if (strcmp(ds, DST) == 0) {
else if (dl >= 0 && strcmp(ds, DST) == 0) {
str = rb_str_new(RSTRING_PTR(str), dl);
dst = 1;
}
......
dl = RSTRING_LEN(str) - (sizeof DST - 1);
ds = RSTRING_PTR(str) + dl;
if (strcmp(ds, DST) == 0) {
if (dl >= 0 && strcmp(ds, DST) == 0) {
str = rb_str_new(RSTRING_PTR(str), dl);
dst = 1;
}
......
char *s, *p;
VALUE sign;
VALUE hour = Qnil, min = Qnil, sec = Qnil;
VALUE str_orig;
s = RSTRING_PTR(str);
str_orig = str;
if (strncmp(s, "gmt", 3) == 0 ||
strncmp(s, "utc", 3) == 0)
......
}
else
min = rb_str_new2(s);
RB_GC_GUARD(str_orig);
goto num;
}
if (strpbrk(RSTRING_PTR(str), ",.")) {
(2-2/2)