stringio 3.0.1 → 3.0.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/ext/stringio/stringio.c +5 -4
- metadata +3 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5fd11c3537d4a5e971cd74083d1e88ae5e605f6fc3c07ca90311e93693817cb0
|
4
|
+
data.tar.gz: 32e5d160f233d71d680fab4141ff10e868523ba2dc25556ea5fc242d4d2098de
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2f6ef3e51b7871a212dee8fb12be59496fffd6bcf75cb42232798cd5f405647b2a6498b8138cea7fb390110e2d9813021981648557c8ec74850e85ac8094e910
|
7
|
+
data.tar.gz: 4d0cc8ee35fd2cb1ac0afb0d516a4af004211fd1aa25a919633ba2671dc5a35e48b0fce3bed2a976a413b6a67a90236e0566cb2a1d72a7e76f13c545fa9d6084
|
data/ext/stringio/stringio.c
CHANGED
@@ -12,7 +12,7 @@
|
|
12
12
|
|
13
13
|
**********************************************************************/
|
14
14
|
|
15
|
-
#define STRINGIO_VERSION "3.0.1"
|
15
|
+
#define STRINGIO_VERSION "3.0.1.2"
|
16
16
|
|
17
17
|
#include "ruby.h"
|
18
18
|
#include "ruby/io.h"
|
@@ -984,7 +984,7 @@ strio_unget_bytes(struct StringIO *ptr, const char *cp, long cl)
|
|
984
984
|
len = RSTRING_LEN(str);
|
985
985
|
rest = pos - len;
|
986
986
|
if (cl > pos) {
|
987
|
-
long ex = (rest < 0 ?
|
987
|
+
long ex = cl - (rest < 0 ? pos : len);
|
988
988
|
rb_str_modify_expand(str, ex);
|
989
989
|
rb_str_set_len(str, len + ex);
|
990
990
|
s = RSTRING_PTR(str);
|
@@ -1233,8 +1233,9 @@ strio_getline(struct getline_arg *arg, struct StringIO *ptr)
|
|
1233
1233
|
str = strio_substr(ptr, ptr->pos, e - s - w, enc);
|
1234
1234
|
}
|
1235
1235
|
else {
|
1236
|
-
if (n < e - s) {
|
1237
|
-
|
1236
|
+
if (n < e - s + arg->chomp) {
|
1237
|
+
/* unless chomping, RS at the end does not matter */
|
1238
|
+
if (e - s < 1024 || n == e - s) {
|
1238
1239
|
for (p = s; p + n <= e; ++p) {
|
1239
1240
|
if (MEMCMP(p, RSTRING_PTR(str), char, n) == 0) {
|
1240
1241
|
e = p + (arg->chomp ? 0 : n);
|
metadata
CHANGED
@@ -1,14 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: stringio
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.0.1
|
4
|
+
version: 3.0.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Nobu Nakada
|
8
|
-
autorequire:
|
9
8
|
bindir: bin
|
10
9
|
cert_chain: []
|
11
|
-
date:
|
10
|
+
date: 2024-03-19 00:00:00.000000000 Z
|
12
11
|
dependencies: []
|
13
12
|
description: Pseudo `IO` class from/to `String`.
|
14
13
|
email: nobu@ruby-lang.org
|
@@ -25,7 +24,6 @@ licenses:
|
|
25
24
|
- Ruby
|
26
25
|
- BSD-2-Clause
|
27
26
|
metadata: {}
|
28
|
-
post_install_message:
|
29
27
|
rdoc_options: []
|
30
28
|
require_paths:
|
31
29
|
- lib
|
@@ -40,8 +38,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
40
38
|
- !ruby/object:Gem::Version
|
41
39
|
version: '2.6'
|
42
40
|
requirements: []
|
43
|
-
rubygems_version: 3.
|
44
|
-
signing_key:
|
41
|
+
rubygems_version: 3.6.0.dev
|
45
42
|
specification_version: 4
|
46
43
|
summary: Pseudo IO on String
|
47
44
|
test_files: []
|