]> git.kaiwu.me - njs.git/commit
Fixed String.prototype.trimEnd() with unicode string.
authorDmitry Volyntsev <xeioex@nginx.com>
Thu, 1 Sep 2022 01:35:58 +0000 (18:35 -0700)
committerDmitry Volyntsev <xeioex@nginx.com>
Thu, 1 Sep 2022 01:35:58 +0000 (18:35 -0700)
commitb9aea5854bcf6f2de8f7a7f1550874e392b94be2
treed27d79367c85c2386768d8dd548e0e97e472c9e8
parent8cd99f9bfeb1b0850107bad10623fbc29793c56a
Fixed String.prototype.trimEnd() with unicode string.

Previously, when the method was invoked with a string consisting of space
characters and at least one of them was a Unicode space separator (code
point above 127) it returned invalid string value with non-zero size
but zero length.

The fix is to update the size of the resulting string appropriately.

This closes #569 issue on Github.
src/njs_string.c
src/test/njs_unit_test.c