File tree Expand file tree Collapse file tree 1 file changed +7
-0
lines changed
src/tools/generate-copyright/src Expand file tree Collapse file tree 1 file changed +7
-0
lines changed Original file line number Diff line number Diff line change @@ -60,7 +60,12 @@ fn main() -> Result<(), Error> {
6060 dependencies : collected_cargo_metadata,
6161 } ;
6262 let output = template. render ( ) ?;
63+ // Git stores text files with \n, but this file may contain \r\n in files
64+ // copied from dependencies. Normalise them before we write them out, for
65+ // consistency.
66+ let output = output. replace ( "\r \n " , "\n " ) ;
6367 if only_check_existing {
68+ std:: fs:: write ( & out_dir. join ( "temp.html" ) , & output) ?;
6469 check_file_contents ( & dest_file, & output) ?;
6570 } else {
6671 std:: fs:: write ( & dest_file, & output) ?;
@@ -72,6 +77,8 @@ fn main() -> Result<(), Error> {
7277 dependencies : library_collected_cargo_metadata,
7378 } ;
7479 let output = template. render ( ) ?;
80+ // Normalise line endings, as above.
81+ let output = output. replace ( "\r \n " , "\n " ) ;
7582 if only_check_existing {
7683 check_file_contents ( & libstd_dest_file, & output) ?;
7784 } else {
You can’t perform that action at this time.
0 commit comments