Skip to content

Commit 0006924

Browse files
authored
Fix escaped backslash crash (#1870)
* Fix escaped backslash crash Fixes #1855. * Code review
1 parent 0248608 commit 0006924

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@
1414
* Produce a better error message for a nested property whose name starts with
1515
`--`.
1616

17+
* Fix a crash when a selector ends in an escaped backslash.
18+
1719
## 1.57.1
1820

1921
* No user-visible changes.

lib/src/utils.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ int? _lastNonWhitespace(String string, {bool excludeEscape = false}) {
114114
if (!isWhitespace(codeUnit)) {
115115
if (excludeEscape &&
116116
i != 0 &&
117-
i != string.length &&
117+
i != string.length - 1 &&
118118
codeUnit == $backslash) {
119119
return i + 1;
120120
} else {

0 commit comments

Comments
 (0)