@@ -96,17 +96,6 @@ impl<'a> Shlex<'a> {
96
96
loop {
97
97
if let Some ( ch2) = self . next_char ( ) {
98
98
match ch2 as char {
99
- '\\' => {
100
- if let Some ( ch3) = self . next_char ( ) {
101
- match ch3 as char {
102
- // for single quotes, only these can be escaped
103
- '\'' | '\\' => { result. push ( ch3) ; } ,
104
- _ => { result. push ( '\\' as u8 ) ; result. push ( ch3) ; }
105
- }
106
- } else {
107
- return Err ( ( ) ) ;
108
- }
109
- } ,
110
99
'\'' => { return Ok ( ( ) ) ; } ,
111
100
_ => { result. push ( ch2) ; } ,
112
101
}
@@ -200,7 +189,7 @@ static SPLIT_TEST_ITEMS: &'static [(&'static str, Option<&'static [&'static str]
200
189
( "foo\\ \n bar" , Some ( & [ "foobar" ] ) ) ,
201
190
( "\" foo\\ \n bar\" " , Some ( & [ "foobar" ] ) ) ,
202
191
( "'baz\\ $b'" , Some ( & [ "baz\\ $b" ] ) ) ,
203
- ( "'baz\\ \' '" , Some ( & [ "baz \' " ] ) ) ,
192
+ ( "'baz\\ \' '" , None ) ,
204
193
( "\\ " , None ) ,
205
194
( "\" \\ " , None ) ,
206
195
( "'\\ " , None ) ,
@@ -210,6 +199,8 @@ static SPLIT_TEST_ITEMS: &'static [(&'static str, Option<&'static [&'static str]
210
199
( "foo #bar" , Some ( & [ "foo" ] ) ) ,
211
200
( "foo#bar" , Some ( & [ "foo#bar" ] ) ) ,
212
201
( "foo\" #bar" , None ) ,
202
+ ( "'\\ n'" , Some ( & [ "\\ n" ] ) ) ,
203
+ ( "'\\ \\ n'" , Some ( & [ "\\ \\ n" ] ) ) ,
213
204
] ;
214
205
215
206
#[ test]
0 commit comments