Skip to content

Commit

Permalink
Fix escaped backslash crash (#1870)
Browse files Browse the repository at this point in the history
* Fix escaped backslash crash

Fixes #1855.

* Code review
  • Loading branch information
jathak committed Jan 25, 2023
1 parent 0248608 commit 0006924
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@
* Produce a better error message for a nested property whose name starts with
`--`.

* Fix a crash when a selector ends in an escaped backslash.

## 1.57.1

* No user-visible changes.
Expand Down
2 changes: 1 addition & 1 deletion lib/src/utils.dart
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ int? _lastNonWhitespace(String string, {bool excludeEscape = false}) {
if (!isWhitespace(codeUnit)) {
if (excludeEscape &&
i != 0 &&
i != string.length &&
i != string.length - 1 &&
codeUnit == $backslash) {
return i + 1;
} else {
Expand Down

0 comments on commit 0006924

Please sign in to comment.