adonthell-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Adonthell-commits] CVS: adonthell/src prefs.cc,1.24,1.25


From: Kai Sterker <address@hidden>
Subject: [Adonthell-commits] CVS: adonthell/src prefs.cc,1.24,1.25
Date: Sun, 15 Sep 2002 16:00:04 -0400

Update of /cvsroot/adonthell/adonthell/src
In directory subversions:/tmp/cvs-serv29346

Modified Files:
        prefs.cc 
Log Message:
IMPROVED comparison of config file and engine version
DISABLED quick load option by default


Index: prefs.cc
===================================================================
RCS file: /cvsroot/adonthell/adonthell/src/prefs.cc,v
retrieving revision 1.24
retrieving revision 1.25
diff -C2 -r1.24 -r1.25
*** prefs.cc    15 Sep 2002 15:52:26 -0000      1.24
--- prefs.cc    15 Sep 2002 20:00:01 -0000      1.25
***************
*** 23,26 ****
--- 23,27 ----
  #include <config.h>
  #endif
+ #include <stdio.h>
  #include <iostream> 
  #include <fstream> 
***************
*** 299,302 ****
--- 300,305 ----
  {
      int n, i = 1;
+     u_int32 major = 0, minor = 0, micro = 0, MAJOR, MINOR, MICRO;
+     char suffix[16], SUFFIX[16]; 
      string s, fname, version;
  
***************
*** 386,390 ****
              case PREFS_VERSION:
              {
!                 if (parse_adonthellrc (n, s) == PREFS_STR) version = s;
                  break;
              }
--- 389,398 ----
              case PREFS_VERSION:
              {
!                 // get config file version number
!                 if (parse_adonthellrc (n, s) == PREFS_STR) 
!                 {
!                     version = s;
!                     sscanf (version.c_str (), "%d.%d.%d%15s", &major, &minor, 
&micro, &suffix);
!                 }
                  break;
              }
***************
*** 395,402 ****
      fclose (prefsin);
  
      // compare version of config file and engine
!     if (version < VERSION)
      {
!         // update config file
          write_adonthellrc ();
      }
--- 403,416 ----
      fclose (prefsin);
  
+     // get engine version numbers
+     sscanf (VERSION, "%d.%d.%d%15s", &MAJOR, &MINOR, &MICRO, &SUFFIX);
+     
      // compare version of config file and engine
!     if (major < MAJOR || 
!         (major == MAJOR && minor < MINOR) ||
!         (major == MAJOR && minor < MINOR && micro < MICRO) ||
!         strcmp (suffix, SUFFIX) != 0)
      {
!         // update config file if engine is newer
          write_adonthellrc ();
      }





reply via email to

[Prev in Thread] Current Thread [Next in Thread]