Skip to content

Commit d5f9293

Browse files
committed
csplit: allow empty regex pattern //
1 parent 5283b7d commit d5f9293

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/uu/csplit/src/patterns.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ pub fn get_patterns(args: &[&str]) -> Result<Vec<Pattern>, CsplitError> {
104104
fn extract_patterns(args: &[&str]) -> Result<Vec<Pattern>, CsplitError> {
105105
let mut patterns = Vec::with_capacity(args.len());
106106
let to_match_reg =
107-
Regex::new(r"^(/(?P<UPTO>.+)/|%(?P<SKIPTO>.+)%)(?P<OFFSET>[\+-]?[0-9]+)?$").unwrap();
107+
Regex::new(r"^(/(?P<UPTO>.*)/|%(?P<SKIPTO>.*)%)(?P<OFFSET>[\+-]?[0-9]+)?$").unwrap();
108108
let execute_ntimes_reg = Regex::new(r"^\{(?P<TIMES>[0-9]+)|\*\}$").unwrap();
109109
let mut iter = args.iter().copied().peekable();
110110

0 commit comments

Comments
 (0)