#19131: wxJoin wxSplit bug

21 views
Skip to first unread message

wxTrac

unread,
Apr 5, 2021, 10:19:02 AM4/5/21
to wx-...@googlegroups.com
#19131: wxJoin wxSplit bug
----------------------------+--------------------
Reporter: deko9 | Owner:
Type: defect | Status: new
Priority: normal | Milestone:
Component: base | Version: 3.1.4
Keywords: wxJoin wxSplit | Blocked By:
Blocking: | Patch: 0
----------------------------+--------------------
When the last character in the substring is the escape character. Then the
string is merged. There were 2 lines, it became 1.

Example, we have 2 lines:
"a\"
"b"
The result of wxJoin (separator ",") is "a\,b".
wxSplt return 1 line - "a\,b".

A possible solution is to escape the escape character "a\\, b".

--
Ticket URL: <https://trac.wxwidgets.org/ticket/19131>

wxTrac

unread,
Apr 5, 2021, 10:22:28 AM4/5/21
to wx-...@googlegroups.com
#19131: wxJoin wxSplit bug
---------------------+----------------------------
Reporter: deko9 | Owner:
Type: defect | Status: new
Priority: normal | Milestone:
Component: base | Version: 3.1.4
Resolution: | Keywords: wxJoin wxSplit
Blocked By: | Blocking:
Patch: 0 |
---------------------+----------------------------
Changes (by deko9):

* cc: dects@… (added)


Comment:

{{{
a\\,b
}}}

--
Ticket URL: <https://trac.wxwidgets.org/ticket/19131#comment:1>

wxTrac

unread,
Apr 6, 2021, 5:36:01 AM4/6/21
to wx-...@googlegroups.com
#19131: wxJoin wxSplit bug
---------------------+----------------------------
Reporter: deko9 | Owner:
Type: defect | Status: confirmed
Priority: normal | Milestone:
Component: base | Version: 3.1.4
Resolution: | Keywords: wxJoin wxSplit
Blocked By: | Blocking:
Patch: 1 |
---------------------+----------------------------
Changes (by vadz):

* status: new => confirmed
* patch: 0 => 1


Comment:

Thanks for reporting this, should be fixed by
[https://github.com/wxWidgets/wxWidgets/pull/2311 this PR].

--
Ticket URL: <https://trac.wxwidgets.org/ticket/19131#comment:2>

wxTrac

unread,
Apr 6, 2021, 9:14:36 PM4/6/21
to wx-...@googlegroups.com
#19131: wxJoin wxSplit bug
---------------------+-------------------------------------
Reporter: deko9 | Owner: Vadim Zeitlin <vadim@…>
Type: defect | Status: closed
Priority: normal | Milestone:
Component: base | Version: 3.1.4
Resolution: fixed | Keywords: wxJoin wxSplit
Blocked By: | Blocking:
Patch: 1 |
---------------------+-------------------------------------
Changes (by Vadim Zeitlin <vadim@…>):

* owner: => Vadim Zeitlin <vadim@…>
* status: confirmed => closed
* resolution: => fixed


Comment:

In [changeset:"1035ae27a7a5d323963cf5249d29fe3112c5ee13/git-wxWidgets"
1035ae27/git-wxWidgets]:
{{{
#!CommitTicketReference repository="git-wxWidgets"
revision="1035ae27a7a5d323963cf5249d29fe3112c5ee13"
Make wxSplit(wxJoin()) idempotent for string ending with escape

Previously, splitting a string obtained by joining together array
with (any but last) elements ending in the escape character (normally
the backslash), didn't recover the original array because the separator
character following it in the resulting string was considered to be
escaped by wxSplit().

Fix this by escaping the trailing escape character itself.

Add a test confirming that this works as expected now, document this
behaviour and also slightly simplify wxSPlit() logic.

See https://github.com/wxWidgets/wxWidgets/pull/2311

Closes #19131.
}}}

--
Ticket URL: <https://trac.wxwidgets.org/ticket/19131#comment:3>
Reply all
Reply to author
Forward
0 new messages