Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/annocheck.yml
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ jobs:
builddir: build
makeup: true

- uses: ruby/setup-ruby@09a7688d3b55cf0e976497ff046b70949eeaccfd # v1.288.0
- uses: ruby/setup-ruby@19a43a6a2428d455dbd1b85344698725179c9d8c # v1.289.0
with:
ruby-version: '3.1'
bundler: none
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/auto_review_pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
with:
persist-credentials: false

- uses: ruby/setup-ruby@09a7688d3b55cf0e976497ff046b70949eeaccfd # v1.288.0
- uses: ruby/setup-ruby@19a43a6a2428d455dbd1b85344698725179c9d8c # v1.289.0
with:
ruby-version: '3.4'
bundler: none
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/baseruby.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ jobs:
- ruby-3.3

steps:
- uses: ruby/setup-ruby@09a7688d3b55cf0e976497ff046b70949eeaccfd # v1.288.0
- uses: ruby/setup-ruby@19a43a6a2428d455dbd1b85344698725179c9d8c # v1.289.0
with:
ruby-version: ${{ matrix.ruby }}
bundler: none
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/bundled_gems.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ jobs:
with:
token: ${{ (github.repository == 'ruby/ruby' && !startsWith(github.event_name, 'pull')) && secrets.MATZBOT_AUTO_UPDATE_TOKEN || secrets.GITHUB_TOKEN }}

- uses: ruby/setup-ruby@09a7688d3b55cf0e976497ff046b70949eeaccfd # v1.288.0
- uses: ruby/setup-ruby@19a43a6a2428d455dbd1b85344698725179c9d8c # v1.289.0
with:
ruby-version: 4.0

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/check_dependencies.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ jobs:

- uses: ./.github/actions/setup/directories

- uses: ruby/setup-ruby@09a7688d3b55cf0e976497ff046b70949eeaccfd # v1.288.0
- uses: ruby/setup-ruby@19a43a6a2428d455dbd1b85344698725179c9d8c # v1.289.0
with:
ruby-version: '3.1'
bundler: none
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/check_misc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
token: ${{ (github.repository == 'ruby/ruby' && !startsWith(github.event_name, 'pull')) && secrets.MATZBOT_AUTO_UPDATE_TOKEN || secrets.GITHUB_TOKEN }}
persist-credentials: false

- uses: ruby/setup-ruby@09a7688d3b55cf0e976497ff046b70949eeaccfd # v1.288.0
- uses: ruby/setup-ruby@19a43a6a2428d455dbd1b85344698725179c9d8c # v1.289.0
with:
ruby-version: head

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/modgc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ jobs:
uses: ./.github/actions/setup/ubuntu
if: ${{ contains(matrix.os, 'ubuntu') }}

- uses: ruby/setup-ruby@09a7688d3b55cf0e976497ff046b70949eeaccfd # v1.288.0
- uses: ruby/setup-ruby@19a43a6a2428d455dbd1b85344698725179c9d8c # v1.289.0
with:
ruby-version: '3.1'
bundler: none
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/parse_y.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ jobs:

- uses: ./.github/actions/setup/ubuntu

- uses: ruby/setup-ruby@09a7688d3b55cf0e976497ff046b70949eeaccfd # v1.288.0
- uses: ruby/setup-ruby@19a43a6a2428d455dbd1b85344698725179c9d8c # v1.289.0
with:
ruby-version: '3.1'
bundler: none
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
with:
persist-credentials: false

- uses: ruby/setup-ruby@09a7688d3b55cf0e976497ff046b70949eeaccfd # v1.288.0
- uses: ruby/setup-ruby@19a43a6a2428d455dbd1b85344698725179c9d8c # v1.289.0
with:
ruby-version: 3.3.4

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/spec_guards.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ jobs:
with:
persist-credentials: false

- uses: ruby/setup-ruby@09a7688d3b55cf0e976497ff046b70949eeaccfd # v1.288.0
- uses: ruby/setup-ruby@19a43a6a2428d455dbd1b85344698725179c9d8c # v1.289.0
with:
ruby-version: ${{ matrix.ruby }}
bundler: none
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/sync_default_gems.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ jobs:
with:
token: ${{ github.repository == 'ruby/ruby' && secrets.MATZBOT_AUTO_UPDATE_TOKEN || secrets.GITHUB_TOKEN }}

- uses: ruby/setup-ruby@09a7688d3b55cf0e976497ff046b70949eeaccfd # v1.288.0
- uses: ruby/setup-ruby@19a43a6a2428d455dbd1b85344698725179c9d8c # v1.289.0
with:
ruby-version: '3.4'
bundler: none
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ubuntu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ jobs:
with:
arch: ${{ matrix.arch }}

- uses: ruby/setup-ruby@09a7688d3b55cf0e976497ff046b70949eeaccfd # v1.288.0
- uses: ruby/setup-ruby@19a43a6a2428d455dbd1b85344698725179c9d8c # v1.289.0
with:
ruby-version: '3.1'
bundler: none
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/wasm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ jobs:
run: |
echo "WASI_SDK_PATH=/opt/wasi-sdk" >> $GITHUB_ENV
- uses: ruby/setup-ruby@09a7688d3b55cf0e976497ff046b70949eeaccfd # v1.288.0
- uses: ruby/setup-ruby@19a43a6a2428d455dbd1b85344698725179c9d8c # v1.289.0
with:
ruby-version: '3.1'
bundler: none
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ jobs:
- run: md build
working-directory:

- uses: ruby/setup-ruby@09a7688d3b55cf0e976497ff046b70949eeaccfd # v1.288.0
- uses: ruby/setup-ruby@19a43a6a2428d455dbd1b85344698725179c9d8c # v1.289.0
with:
# windows-11-arm has only 3.4.1, 3.4.2, 3.4.3, head
ruby-version: ${{ !endsWith(matrix.os, 'arm') && '3.1' || '3.4' }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/yjit-ubuntu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ jobs:

- uses: ./.github/actions/setup/ubuntu

- uses: ruby/setup-ruby@09a7688d3b55cf0e976497ff046b70949eeaccfd # v1.288.0
- uses: ruby/setup-ruby@19a43a6a2428d455dbd1b85344698725179c9d8c # v1.289.0
with:
ruby-version: '3.1'
bundler: none
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/zjit-macos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ jobs:
rustup install ${{ matrix.rust_version }} --profile minimal
rustup default ${{ matrix.rust_version }}
- uses: taiki-e/install-action@205eb1d74c6feda89abb1f3a09360601953286c0 # v2.68.18
- uses: taiki-e/install-action@385db9cc6bf65d19775b02084a4b698eaca9a4f2 # v2.68.19
with:
tool: nextest@0.9
if: ${{ matrix.test_task == 'zjit-check' }}
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/zjit-ubuntu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -114,12 +114,12 @@ jobs:

- uses: ./.github/actions/setup/ubuntu

- uses: ruby/setup-ruby@09a7688d3b55cf0e976497ff046b70949eeaccfd # v1.288.0
- uses: ruby/setup-ruby@19a43a6a2428d455dbd1b85344698725179c9d8c # v1.289.0
with:
ruby-version: '3.1'
bundler: none

- uses: taiki-e/install-action@205eb1d74c6feda89abb1f3a09360601953286c0 # v2.68.18
- uses: taiki-e/install-action@385db9cc6bf65d19775b02084a4b698eaca9a4f2 # v2.68.19
with:
tool: nextest@0.9
if: ${{ matrix.test_task == 'zjit-check' }}
Expand Down
3 changes: 3 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,8 @@ releases.
* strscan 3.1.7.dev
* 3.1.6 to [v3.1.7][strscan-v3.1.7]
* syntax_suggest 2.0.3
* zlib 3.2.3
* 3.2.2 to [v3.2.3][zlib-v3.2.3]

### The following bundled gems are updated.

Expand Down Expand Up @@ -136,6 +138,7 @@ A lot of work has gone into making Ractors more stable, performant, and usable.
[prism-v1.9.0]: https://github.com/ruby/prism/releases/tag/v1.9.0
[resolv-v0.7.1]: https://github.com/ruby/resolv/releases/tag/v0.7.1
[strscan-v3.1.7]: https://github.com/ruby/strscan/releases/tag/v3.1.7
[zlib-v3.2.3]: https://github.com/ruby/zlib/releases/tag/v3.2.3
[test-unit-3.7.4]: https://github.com/test-unit/test-unit/releases/tag/3.7.4
[test-unit-3.7.5]: https://github.com/test-unit/test-unit/releases/tag/3.7.5
[test-unit-3.7.6]: https://github.com/test-unit/test-unit/releases/tag/3.7.6
Expand Down
25 changes: 25 additions & 0 deletions doc/contributing/documentation_guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -288,6 +288,30 @@ The link should lead to a target in https://docs.ruby-lang.org/en/master/.

Also use a full URL-based link for a link to an off-site document.

#### Fragments

In general, a link that includes a [fragment][fragment]
must cite the exact identifier on the target page;
otherwise, the browser finds no suitable identifier,
and does not scroll to the desired part of the page.

However, certain pages on `github.com` and `github.io`
support "fuzzy" identifier matching, so that URL
https://github.com/rdp/ruby_tutorials_core/wiki/Ruby-Talk-FAQ#-why-are-rubys-floats-imprecise,
(whose fragment is `-why-are-rubys-floats-imprecise`)
scrolls to heading "Why are ruby’s floats imprecise?"
even though the identifier there actually is the longer
`#user-content--why-are-rubys-floats-imprecise`.

Ruby documentation should avoid using these shortened fragments, for two reasons:

- The GitHub pages that do this implement it using Javascript;
if the user's browser has Javascript disabled
(which some employers actually require),
the shortened fragment is ineffective and the desired scrolling does not occur.
- A program that checks links in Ruby documentation will find no suitable identifier,
and therefore will report the fragment as not found.

### Variable Names

The name of a variable (as specified in its call-seq) should be marked up as
Expand Down Expand Up @@ -617,6 +641,7 @@ best to use a separate paragraph for each case you are discussing.
[bold text]: https://ruby.github.io/rdoc/doc/markup_reference/rdoc_rdoc.html#bold
[call-seq]: https://ruby.github.io/rdoc/doc/markup_reference/rdoc_rdoc.html#directive-for-specifying-rdoc-source-format
[code blocks]: https://ruby.github.io/rdoc/doc/markup_reference/rdoc_rdoc.html#code-blocks
[fragment]: https://developer.mozilla.org/en-US/docs/Web/URI/Reference/Fragment
[headings]: https://ruby.github.io/rdoc/doc/markup_reference/rdoc_rdoc.html#headings
[irb]: https://ruby.github.io/irb/index.html
[links]: https://ruby.github.io/rdoc/doc/markup_reference/rdoc_rdoc.html#links
Expand Down
6 changes: 2 additions & 4 deletions ext/zlib/zlib.c
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
# define VALGRIND_MAKE_MEM_UNDEFINED(p, n) 0
#endif

#define RUBY_ZLIB_VERSION "3.2.2"
#define RUBY_ZLIB_VERSION "3.2.3"

#ifndef RB_PASS_CALLED_KEYWORDS
# define rb_class_new_instance_kw(argc, argv, klass, kw_splat) rb_class_new_instance(argc, argv, klass)
Expand Down Expand Up @@ -860,9 +860,7 @@ zstream_buffer_ungets(struct zstream *z, const Bytef *b, unsigned long len)
char *bufptr;
long filled;

if (NIL_P(z->buf) || (long)rb_str_capacity(z->buf) <= ZSTREAM_BUF_FILLED(z)) {
zstream_expand_buffer_into(z, len);
}
zstream_expand_buffer_into(z, len);

RSTRING_GETMEM(z->buf, bufptr, filled);
memmove(bufptr + len, bufptr, filled);
Expand Down
19 changes: 19 additions & 0 deletions test/zlib/test_zlib.rb
Original file line number Diff line number Diff line change
Expand Up @@ -882,6 +882,25 @@ def test_ungetc_at_start_of_file
assert_equal(-1, r.pos, "[ruby-core:81488][Bug #13616]")
end

def test_ungetc_buffer_underflow
initial_bufsize = 1024
payload = "A" * initial_bufsize
gzip_io = StringIO.new
Zlib::GzipWriter.wrap(gzip_io) { |gz| gz.write(payload) }
compressed = gzip_io.string

reader = Zlib::GzipReader.new(StringIO.new(compressed))
reader.read(1)
overflow_bytes = "B" * (initial_bufsize)
reader.ungetc(overflow_bytes)
data = reader.read(overflow_bytes.bytesize)
assert_equal overflow_bytes.bytesize, data.bytesize, data
assert_empty data.delete("B"), data
data = reader.read()
assert_equal initial_bufsize - 1, data.bytesize, data
assert_empty data.delete("A"), data
end

def test_open
Tempfile.create("test_zlib_gzip_reader_open") {|t|
t.close
Expand Down
Loading