diff options
| author | Lenny Komow <lenny@lunarg.com> | 2016-09-02 14:05:45 -0600 |
|---|---|---|
| committer | Lenny Komow <lenny@lunarg.com> | 2016-09-02 14:06:53 -0600 |
| commit | 2f6989a58c90d47c16be9d5f49217bcf77b04509 (patch) | |
| tree | be18c2312edaf846748ce22af4a0d0fccda31c66 /windowsRuntimeInstaller/configure_runtime.c | |
| parent | 3f8c4ffead8818aeab04360eac630d8e8c5136f2 (diff) | |
| download | usermoji-2f6989a58c90d47c16be9d5f49217bcf77b04509.tar.xz | |
winsdk: Fix releases showing as older than alphas
Diffstat (limited to 'windowsRuntimeInstaller/configure_runtime.c')
| -rw-r--r-- | windowsRuntimeInstaller/configure_runtime.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/windowsRuntimeInstaller/configure_runtime.c b/windowsRuntimeInstaller/configure_runtime.c index bc5a6b04..a8460a16 100644 --- a/windowsRuntimeInstaller/configure_runtime.c +++ b/windowsRuntimeInstaller/configure_runtime.c @@ -270,6 +270,7 @@ int add_explicit_layers(FILE* log, const char* install_path, enum Platform platf int compare_versions(const struct SDKVersion* a, const struct SDKVersion* b)
{
+ // Compare numerical versions
for(int i = 0; i < 4; ++i) {
long* a_current = ((long*) a) + i;
long* b_current = ((long*) b) + i;
@@ -281,6 +282,14 @@ int compare_versions(const struct SDKVersion* a, const struct SDKVersion* b) }
}
+ // An empty string should be considered greater (and therefore more recent) than one with test
+ if(a->extended[0] == '\0' && b->extended[0] != '\0') {
+ return 1;
+ } else if(b->extended[0] == '\0' && a->extended[0] != '\0') {
+ return -1;
+ }
+
+ // Otherwise, just do a strncmp
return strncmp(a->extended, b->extended, SDK_VERSION_BUFFER_SIZE);
}
|
