ntdll: rtlstr.c: Implement checking for control characters in RtlIsTextUnicode [try 4]

Zac Brown zac at zacbrown.org
Thu Jun 19 23:49:49 CDT 2008


Michael Karcher wrote:
> Am Donnerstag, den 19.06.2008, 12:52 -0700 schrieb Zac Brown:
>> - Because these tests are mutually exclusive, a single goto label suffices for 
>> breaking the loop.
> 
> As written, your tests are not mutually exclusive. It could happen that
> flags has IS_TEXT_UNICODE_CONTROLS and IS_TEXT_UNICODE_REVERSE_CONTROLS,
> set and out_flags contains IS_TEXT_UNICODE_REVERSE_SIGNATURE. (If the
> caller doesn't provide flags, both flags are set, in fact!) In that
> case, both conditions of your if statements are true.
> 
> I don't know whether that means that you need two goto targets or that
> your logic should be changed, but I suspect the latter. If you test for
> reversed control characters only I a reversed BOM was found, you should
> not test for non-reversed control characters if a reversed BOM was
> found, according to my intuition.
> 
> Regards,
>   Michael Karcher
> 
> 
> 
After re-reading the documentation, it is unclear as to whether the tests are 
truly mutually exclusive. I took the mutually exclusive hint from comments in 
the code actually.

Does anyone have feedback on whether they believe the tests for normal control 
characters vs reversed control characters should be mutually exlusive? To me it 
makes sense for them to be, but that doesn't necessarily mean they should be...

Documentation for those interested: 
http://msdn.microsoft.com/en-us/library/ms776445.aspx

Comments are welcome and *greatly* appreciated.

-Zac



More information about the wine-devel mailing list