@@ -70,7 +70,13 @@ use std::io::Read;
7070 "no file name for AFL.rs seed test case" ,
7171 )
7272 } ) ?;
73- println ! ( "cargo:rerun-if-changed=in/{}" , Path :: new( file_name) . display( ) ) ;
73+ println ! (
74+ "cargo:rerun-if-changed=in/{}" ,
75+ Path :: new( file_name) . display( )
76+ ) ;
77+
78+ // properly escape windows paths
79+ let path = path. to_string_lossy ( ) . replace ( "\\ " , "\\ \\ " ) ;
7480
7581 writeln ! (
7682 & mut test_file,
@@ -85,7 +91,7 @@ fn test_afl_seed_{}() {{
8591}}
8692"# ,
8793 file_name. to_string_lossy( ) ,
88- path. to_string_lossy ( )
94+ path
8995 ) ?;
9096 }
9197
@@ -190,7 +196,7 @@ use std::fmt::Write;
190196 Some ( Err ( e) ) => return Err ( e) ,
191197 } ;
192198
193- if options. find ( "--no-params" ) . is_some ( ) {
199+ if options. contains ( "--no-params" ) {
194200 // This line is the expected demangled output without function and
195201 // template parameters, but we don't currently have such an option
196202 // in `cpp_demangle`, so just consume and ignore the line.
@@ -207,10 +213,10 @@ use std::fmt::Write;
207213 }
208214
209215 // Skip tests for unsupported languages or options.
210- if options. find ( "--format=gnu-v3" ) . is_none ( )
211- || options. find ( "--is-v3-ctor" ) . is_some ( )
212- || options. find ( "--is-v3-dtor" ) . is_some ( )
213- || options. find ( "--ret-postfix" ) . is_some ( )
216+ if ! options. contains ( "--format=gnu-v3" )
217+ || options. contains ( "--is-v3-ctor" )
218+ || options. contains ( "--is-v3-dtor" )
219+ || options. contains ( "--ret-postfix" )
214220 {
215221 continue ;
216222 }
0 commit comments