Skip to content

Commit ab394a0

Browse files
committed
expr: Handle '$' at the end of the pattern
1 parent a83d24a commit ab394a0

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/uu/expr/src/syntax_tree.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -193,6 +193,8 @@ impl StringOp {
193193
_ => re_string.push_str(r"\$"),
194194
}
195195
re_string.push(backslash);
196+
} else if pattern_chars.peek().is_none() {
197+
re_string.push('$');
196198
} else if prev_is_escaped || prev != '\\' {
197199
re_string.push_str(r"\$");
198200
} else {

0 commit comments

Comments
 (0)