@@ -141,29 +141,21 @@ unsafe bool ScanBeginMarker (ref byte* inptr, byte* inend)
141141 if ( nsaved != 0 && nsaved != ( byte ) '\n ' ) {
142142 byte * start = inptr ;
143143
144- // only lines containing whitespace are allowed before the begin marker
145- while ( inptr < inend && * inptr != ( byte ) '\n ' ) {
146- if ( ! invalidPretext && ! ( * inptr ) . IsWhitespace ( ) ) {
147- // FIXME: should this really be emitted for *each* character before the 'begin'?
148- reader . OnMimeComplianceViolation ( MimeComplianceViolation . InvalidUUEncodePretext , streamOffset + ( int ) ( inptr - start ) , lineNumber ) ;
149- invalidPretext = true ;
150- }
151-
144+ // skip ahead to the next line...
145+ while ( inptr < inend && * inptr != ( byte ) '\n ' )
152146 inptr ++ ;
153- }
147+
148+ streamOffset += ( int ) ( inptr - start ) ;
154149
155150 if ( inptr == inend ) {
156- streamOffset += ( int ) ( inptr - start ) ;
157151 nsaved = * ( inptr - 1 ) ;
158- return false ;
152+ break ;
159153 }
160154
161- streamOffset += ( int ) ( inptr - start ) ;
162-
163- SkipByte ( ref inptr ) ;
155+ nsaved = ReadByte ( ref inptr ) ;
164156
165157 if ( inptr == inend )
166- return false ;
158+ break ;
167159 }
168160
169161 nsaved = ReadByte ( ref inptr ) ;
@@ -183,7 +175,7 @@ unsafe bool ScanBeginMarker (ref byte* inptr, byte* inend)
183175
184176 state = UUValidatorState . B ;
185177 if ( inptr == inend )
186- return false ;
178+ break ;
187179 }
188180
189181 if ( state == UUValidatorState . B ) {
@@ -199,7 +191,7 @@ unsafe bool ScanBeginMarker (ref byte* inptr, byte* inend)
199191
200192 state = UUValidatorState . Be ;
201193 if ( inptr == inend )
202- return false ;
194+ break ;
203195 }
204196
205197 if ( state == UUValidatorState . Be ) {
@@ -215,7 +207,7 @@ unsafe bool ScanBeginMarker (ref byte* inptr, byte* inend)
215207
216208 state = UUValidatorState . Beg ;
217209 if ( inptr == inend )
218- return false ;
210+ break ;
219211 }
220212
221213 if ( state == UUValidatorState . Beg ) {
@@ -231,7 +223,7 @@ unsafe bool ScanBeginMarker (ref byte* inptr, byte* inend)
231223
232224 state = UUValidatorState . Begi ;
233225 if ( inptr == inend )
234- return false ;
226+ break ;
235227 }
236228
237229 if ( state == UUValidatorState . Begi ) {
@@ -247,7 +239,7 @@ unsafe bool ScanBeginMarker (ref byte* inptr, byte* inend)
247239
248240 state = UUValidatorState . Begin ;
249241 if ( inptr == inend )
250- return false ;
242+ break ;
251243 }
252244
253245 if ( state == UUValidatorState . Begin ) {
@@ -265,7 +257,7 @@ unsafe bool ScanBeginMarker (ref byte* inptr, byte* inend)
265257 nsaved = 0 ;
266258
267259 if ( inptr == inend )
268- return false ;
260+ break ;
269261 }
270262
271263 if ( state == UUValidatorState . FileMode ) {
@@ -282,7 +274,7 @@ unsafe bool ScanBeginMarker (ref byte* inptr, byte* inend)
282274 }
283275
284276 if ( inptr == inend )
285- return false ;
277+ break ;
286278
287279 if ( nsaved < 3 ) {
288280 // file mode is too short
@@ -303,7 +295,7 @@ unsafe bool ScanBeginMarker (ref byte* inptr, byte* inend)
303295 nsaved = 0 ;
304296
305297 if ( inptr == inend )
306- return false ;
298+ break ;
307299 }
308300
309301 if ( state == UUValidatorState . FileName ) {
@@ -312,14 +304,13 @@ unsafe bool ScanBeginMarker (ref byte* inptr, byte* inend)
312304 while ( inptr < inend && * inptr != ( byte ) '\n ' )
313305 inptr ++ ;
314306
307+ streamOffset += ( int ) ( inptr - start ) ;
308+
315309 if ( inptr == inend ) {
316310 // need to keep reading until we hit the end of the line
317- streamOffset += ( int ) ( inptr - start ) ;
318- return false ;
311+ break ;
319312 }
320313
321- streamOffset += ( int ) ( inptr - start ) ;
322-
323314 SkipByte ( ref inptr ) ;
324315
325316 state = UUValidatorState . Payload ;
0 commit comments