date 3.0.0 → 3.0.1
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of date might be problematic. Click here for more details.
- checksums.yaml +4 -4
- data/ext/date/date_core.c +6 -2
- data/ext/date/date_parse.c +11 -11
- metadata +7 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9f891e1846f83381a22586299aaa6831910cd9ba63e4a02d6c82db073a4794ba
|
4
|
+
data.tar.gz: 13bfb909f575de2dc192b95eab90c1808e175327d446ea52d6f137bb3fca99e5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 59414c762a7440353fcb0aa66a6b0320b23d15ff2b5557fe950a68655c432af4c5e934e6ac9c78c982db2d0afa90618e554a8dc3f810949bd501f952cd39005b
|
7
|
+
data.tar.gz: 0f7700b96cb1ad9521aac3eb1b283bdcef38fd6fc6f98e042b011f69751f251e288f0a753148ad61e93d9e8b48bbb629ae9d8d94fcb5aff64366d56209476602
|
data/ext/date/date_core.c
CHANGED
@@ -11,6 +11,7 @@
|
|
11
11
|
#include <sys/time.h>
|
12
12
|
#endif
|
13
13
|
|
14
|
+
#undef NDEBUG
|
14
15
|
#define NDEBUG
|
15
16
|
#include <assert.h>
|
16
17
|
|
@@ -7201,11 +7202,14 @@ d_lite_marshal_load(VALUE self, VALUE a)
|
|
7201
7202
|
|
7202
7203
|
if (simple_dat_p(dat)) {
|
7203
7204
|
if (df || !f_zero_p(sf) || of) {
|
7204
|
-
|
7205
|
-
|
7205
|
+
/* loading a fractional date; promote to complex */
|
7206
|
+
dat = ruby_xrealloc(dat, sizeof(struct ComplexDateData));
|
7207
|
+
RTYPEDDATA(self)->data = dat;
|
7208
|
+
goto complex_data;
|
7206
7209
|
}
|
7207
7210
|
set_to_simple(self, &dat->s, nth, jd, sg, 0, 0, 0, HAVE_JD);
|
7208
7211
|
} else {
|
7212
|
+
complex_data:
|
7209
7213
|
set_to_complex(self, &dat->c, nth, jd, df, sf, of, sg,
|
7210
7214
|
0, 0, 0, 0, 0, 0,
|
7211
7215
|
HAVE_JD | HAVE_DF);
|
data/ext/date/date_parse.c
CHANGED
@@ -70,7 +70,7 @@ static size_t
|
|
70
70
|
digit_span(const char *s, const char *e)
|
71
71
|
{
|
72
72
|
size_t i = 0;
|
73
|
-
while (s + i < e && isdigit(s[i])) i++;
|
73
|
+
while (s + i < e && isdigit((unsigned char)s[i])) i++;
|
74
74
|
return i;
|
75
75
|
}
|
76
76
|
|
@@ -110,7 +110,7 @@ s3e(VALUE hash, VALUE y, VALUE m, VALUE d, int bc)
|
|
110
110
|
|
111
111
|
s = RSTRING_PTR(y);
|
112
112
|
ep = RSTRING_END(y);
|
113
|
-
while (s < ep && !issign(*s) && !isdigit(*s))
|
113
|
+
while (s < ep && !issign(*s) && !isdigit((unsigned char)*s))
|
114
114
|
s++;
|
115
115
|
if (s >= ep) goto no_date;
|
116
116
|
bp = s;
|
@@ -162,7 +162,7 @@ s3e(VALUE hash, VALUE y, VALUE m, VALUE d, int bc)
|
|
162
162
|
|
163
163
|
s = RSTRING_PTR(y);
|
164
164
|
ep = RSTRING_END(y);
|
165
|
-
while (s < ep && !issign(*s) && !isdigit(*s))
|
165
|
+
while (s < ep && !issign(*s) && !isdigit((unsigned char)*s))
|
166
166
|
s++;
|
167
167
|
if (s >= ep) goto no_year;
|
168
168
|
bp = s;
|
@@ -199,7 +199,7 @@ s3e(VALUE hash, VALUE y, VALUE m, VALUE d, int bc)
|
|
199
199
|
|
200
200
|
s = RSTRING_PTR(m);
|
201
201
|
ep = RSTRING_END(m);
|
202
|
-
while (s < ep && !isdigit(*s))
|
202
|
+
while (s < ep && !isdigit((unsigned char)*s))
|
203
203
|
s++;
|
204
204
|
if (s >= ep) goto no_month;
|
205
205
|
bp = s;
|
@@ -225,7 +225,7 @@ s3e(VALUE hash, VALUE y, VALUE m, VALUE d, int bc)
|
|
225
225
|
|
226
226
|
s = RSTRING_PTR(d);
|
227
227
|
ep = RSTRING_END(d);
|
228
|
-
while (s < ep && !isdigit(*s))
|
228
|
+
while (s < ep && !isdigit((unsigned char)*s))
|
229
229
|
s++;
|
230
230
|
if (s >= ep) goto no_mday;
|
231
231
|
bp = s;
|
@@ -364,9 +364,9 @@ static int
|
|
364
364
|
str_end_with_word(const char *s, long l, const char *w)
|
365
365
|
{
|
366
366
|
int n = (int)strlen(w);
|
367
|
-
if (l <= n || !isspace(s[l - n - 1])) return 0;
|
367
|
+
if (l <= n || !isspace((unsigned char)s[l - n - 1])) return 0;
|
368
368
|
if (strncasecmp(&s[l - n], w, n)) return 0;
|
369
|
-
do ++n; while (l > n && isspace(s[l - n - 1]));
|
369
|
+
do ++n; while (l > n && isspace((unsigned char)s[l - n - 1]));
|
370
370
|
return n;
|
371
371
|
}
|
372
372
|
|
@@ -376,7 +376,7 @@ shrunk_size(const char *s, long l)
|
|
376
376
|
long i, ni;
|
377
377
|
int sp = 0;
|
378
378
|
for (i = ni = 0; i < l; ++i) {
|
379
|
-
if (!isspace(s[i])) {
|
379
|
+
if (!isspace((unsigned char)s[i])) {
|
380
380
|
if (sp) ni++;
|
381
381
|
sp = 0;
|
382
382
|
ni++;
|
@@ -394,7 +394,7 @@ shrink_space(char *d, const char *s, long l)
|
|
394
394
|
long i, ni;
|
395
395
|
int sp = 0;
|
396
396
|
for (i = ni = 0; i < l; ++i) {
|
397
|
-
if (!isspace(s[i])) {
|
397
|
+
if (!isspace((unsigned char)s[i])) {
|
398
398
|
if (sp) d[ni++] = ' ';
|
399
399
|
sp = 0;
|
400
400
|
d[ni++] = s[i];
|
@@ -754,8 +754,8 @@ check_year_width(VALUE y)
|
|
754
754
|
l = RSTRING_LEN(y);
|
755
755
|
if (l < 2) return 0;
|
756
756
|
s = RSTRING_PTR(y);
|
757
|
-
if (!isdigit(s[1])) return 0;
|
758
|
-
return (l == 2 || !isdigit(s[2]));
|
757
|
+
if (!isdigit((unsigned char)s[1])) return 0;
|
758
|
+
return (l == 2 || !isdigit((unsigned char)s[2]));
|
759
759
|
}
|
760
760
|
|
761
761
|
static int
|
metadata
CHANGED
@@ -1,18 +1,18 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: date
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.0.
|
4
|
+
version: 3.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Tadayoshi Funaba
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2020-06-19 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: A subclass of Object includes Comparable module for handling dates.
|
14
14
|
email:
|
15
|
-
-
|
15
|
+
-
|
16
16
|
executables: []
|
17
17
|
extensions:
|
18
18
|
- ext/date/extconf.rb
|
@@ -32,7 +32,7 @@ homepage: https://github.com/ruby/date
|
|
32
32
|
licenses:
|
33
33
|
- BSD-2-Clause
|
34
34
|
metadata: {}
|
35
|
-
post_install_message:
|
35
|
+
post_install_message:
|
36
36
|
rdoc_options: []
|
37
37
|
require_paths:
|
38
38
|
- lib
|
@@ -47,8 +47,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
47
47
|
- !ruby/object:Gem::Version
|
48
48
|
version: '0'
|
49
49
|
requirements: []
|
50
|
-
rubygems_version: 3.0.
|
51
|
-
signing_key:
|
50
|
+
rubygems_version: 3.2.0.pre1
|
51
|
+
signing_key:
|
52
52
|
specification_version: 4
|
53
53
|
summary: A subclass of Object includes Comparable module for handling dates.
|
54
54
|
test_files: []
|