Version detection code was total pants.
authorRyan C. Gordon <icculus@icculus.org>
Wed, 23 Mar 2005 22:18:27 +0000
changeset 76 38a9ee7c1d44
parent 75 6e3546e565bc
child 77 809774c1e78d
Version detection code was total pants.
mojopatch.c
platform.h
platform_unix.c
--- a/mojopatch.c	Wed Mar 23 21:48:55 2005 +0000
+++ b/mojopatch.c	Wed Mar 23 22:18:27 2005 +0000
@@ -588,7 +588,7 @@
 
 
 /* don't taunt this function. */
-int version_ok(const char *ver, const char *allowed_ver)
+int version_ok(const char *ver, const char *allowed_ver, const char *newver)
 {
     char *ptr;
     char *buf;
@@ -596,7 +596,7 @@
     if (*allowed_ver == '\0')
         return 1;  /* No specified version? Anything is okay, then. */
 
-    if (strcmp(allowed_ver, ver) == 0)
+    if (strcmp(allowed_ver, newver) == 0)
         return -1;  /* all patched up. */
 
     buf = (char *) alloca(strlen(allowed_ver) + 1);
--- a/platform.h	Wed Mar 23 21:48:55 2005 +0000
+++ b/platform.h	Wed Mar 23 22:18:27 2005 +0000
@@ -49,7 +49,7 @@
 /* Call this for logging (debug info). */
 void _dlog(const char *fmt, ...);
 
-int version_ok(const char *ver, const char *allowed);
+int version_ok(const char *ver, const char *allowed, const char *newver);
 
 /* platform-specific stuff you implement. */
 int file_exists(const char *fname);
--- a/platform_unix.c	Wed Mar 23 21:48:55 2005 +0000
+++ b/platform_unix.c	Wed Mar 23 22:18:27 2005 +0000
@@ -331,7 +331,7 @@
     if (ptr != NULL)
     {
         knowver = 1;
-        retval = version_ok(ptr, version);
+        retval = version_ok(ptr, version, newversion);
         if (retval == -1)
             _fatal("You seem to be all patched up already!");
         else if (retval == 0)