mirror of
https://github.com/sparkle-project/Sparkle
synced 2026-11-29 05:24:26 +00:00
Fixes #222: Long version ids (12 digits based on reverse date) cause update to work no longer
This commit is contained in:
1 parent
b86770c39f
commit
7b3928db9b
2 files changed
+11
-6
No files matched your search
@@ -84,8 +84,8 @@ typedef enum {
|
||||
NSArray *partsB = [self splitVersionString:versionB];
|
||||
|
||||
NSString *partA, *partB;
|
||||
NSUInteger i, n;
|
||||
int intA, intB;
|
||||
int i, n;
|
||||
long long valueA, valueB;
|
||||
SUCharacterType typeA, typeB;
|
||||
|
||||
n = MIN([partsA count], [partsB count]);
|
||||
@@ -100,11 +100,11 @@ typedef enum {
|
||||
if (typeA == typeB) {
|
||||
// Same type; we can compare
|
||||
if (typeA == kNumberType) {
|
||||
intA = [partA intValue];
|
||||
intB = [partB intValue];
|
||||
if (intA > intB) {
|
||||
valueA = [partA longLongValue];
|
||||
valueB = [partB longLongValue];
|
||||
if (valueA > valueB) {
|
||||
return NSOrderedDescending;
|
||||
} else if (intA < intB) {
|
||||
} else if (valueA < valueB) {
|
||||
return NSOrderedAscending;
|
||||
}
|
||||
} else if (typeA == kStringType) {
|
||||
|
||||
@@ -59,4 +59,9 @@
|
||||
// SUAssertEqual(@"1.0 - beta", @"1.0 beta");
|
||||
}
|
||||
|
||||
- (void)testVersionsWithReverseDateBasedNumbers
|
||||
{
|
||||
SUAssertAscending(@"201210251627", @"201211051041");
|
||||
}
|
||||
|
||||
@end
|
||||
Reference in new issue
Block a user