File tree Expand file tree Collapse file tree
tools/BootstrapBlazor.CssBundler Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -71,20 +71,19 @@ static void DoBundler(string bundlerFile, BundlerOptions option)
7171 }
7272
7373 using var reader = File . OpenRead ( inputFile ) ;
74- while ( true )
74+ var read = reader . Read ( buffer , 0 , buffer . Length ) ;
75+ if ( read >= 3 && buffer [ 0 ] == 0xEF && buffer [ 1 ] == 0xBB && buffer [ 2 ] == 0xBF )
7576 {
76- var read = reader . Read ( buffer , 0 , buffer . Length ) ;
77- if ( read == 0 )
78- {
79- break ;
80- }
77+ writer . Write ( buffer , 3 , read - 3 ) ;
78+ }
79+ else
80+ {
81+ writer . Write ( buffer , 0 , read ) ;
82+ }
8183
82- if ( reader . Position == read && read >= 3 && buffer [ 0 ] == 0xEF && buffer [ 1 ] == 0xBB && buffer [ 2 ] == 0xBF )
83- {
84- // skip bom
85- writer . Write ( buffer , 3 , read - 3 ) ;
86- continue ;
87- }
84+ while ( reader . Position < reader . Length )
85+ {
86+ read = reader . Read ( buffer , 0 , buffer . Length ) ;
8887 writer . Write ( buffer , 0 , read ) ;
8988 }
9089 }
You can’t perform that action at this time.
0 commit comments