@@ -70,7 +70,13 @@ use std::io::Read;
70
70
"no file name for AFL.rs seed test case" ,
71
71
)
72
72
} ) ?;
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 ( "\\ " , "\\ \\ " ) ;
74
80
75
81
writeln ! (
76
82
& mut test_file,
@@ -85,7 +91,7 @@ fn test_afl_seed_{}() {{
85
91
}}
86
92
"# ,
87
93
file_name. to_string_lossy( ) ,
88
- path. to_string_lossy ( )
94
+ path
89
95
) ?;
90
96
}
91
97
@@ -190,7 +196,7 @@ use std::fmt::Write;
190
196
Some ( Err ( e) ) => return Err ( e) ,
191
197
} ;
192
198
193
- if options. find ( "--no-params" ) . is_some ( ) {
199
+ if options. contains ( "--no-params" ) {
194
200
// This line is the expected demangled output without function and
195
201
// template parameters, but we don't currently have such an option
196
202
// in `cpp_demangle`, so just consume and ignore the line.
@@ -207,10 +213,10 @@ use std::fmt::Write;
207
213
}
208
214
209
215
// 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" )
214
220
{
215
221
continue ;
216
222
}
0 commit comments