diff --git a/ChangeLog b/ChangeLog index 841ccc4ec..1c566a5d3 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2000-06-21 Richard Frith-Macdonald + + * Source/NSScanner.m: ([-scanHexInt:]) fixed to permit leading 0x or 0X + 2000-06-20 Richard Frith-Macdonald * configure.in: Added check for recent libxml diff --git a/Source/NSScanner.m b/Source/NSScanner.m index 742166e93..6d8f9e62b 100644 --- a/Source/NSScanner.m +++ b/Source/NSScanner.m @@ -394,6 +394,24 @@ typedef struct { _scanLocation = saveScanLocation; return NO; } + + if ((_scanLocation < myLength()) && (myCharacter(_scanLocation) == '0')) + { + _scanLocation++; + if (_scanLocation < myLength()) + { + switch (myCharacter(_scanLocation)) + { + case 'x': + case 'X': + _scanLocation++; + break; + default: + _scanLocation--; + break; + } + } + } if ([self scanUnsignedInt_: value radix: 16 gotDigits: NO]) return YES; _scanLocation = saveScanLocation;