Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Version detection code was total pants.
  • Loading branch information
icculus committed Mar 23, 2005
1 parent 5c622aa commit 0133d0e
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions mojopatch.c
Expand Up @@ -588,15 +588,15 @@ static void _current_operation(const char *fmt, ...)


/* 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;

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);
Expand Down
2 changes: 1 addition & 1 deletion platform.h
Expand Up @@ -49,7 +49,7 @@ void _log(const char *fmt, ...);
/* 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);
Expand Down
2 changes: 1 addition & 1 deletion platform_unix.c
Expand Up @@ -331,7 +331,7 @@ static int parse_info_dot_plist(const char *ident,
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)
Expand Down

0 comments on commit 0133d0e

Please sign in to comment.