Changeset 989 for trunk/dll/init.c


Ignore:
Timestamp:
Mar 2, 2008, 12:34:12 AM (17 years ago)
Author:
Gregg Young
Message:

Refactor fm3dll.h to create command.h; broken ini is now replaced with backup or new ini as available; more variable command line ledth changes

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/dll/init.c

    r985 r989  
    714714    }
    715715    else {
    716       if (!CheckFileHeader(inipath, "\xff\xff\xff\xff\x14\x00\x00\x00", 0L))
    717         saymsg(MB_ENTER,HWND_DESKTOP,DEBUG_STRING, "Check INI header failed");
    718       fIniExisted = TRUE;
    719       if (fs3.attrFile & (FILE_READONLY | FILE_HIDDEN | FILE_SYSTEM)) {
    720         fs3.attrFile &= ~(FILE_READONLY | FILE_HIDDEN | FILE_SYSTEM);
    721         rc = xDosSetPathInfo(inipath, FIL_STANDARD, &fs3, sizeof(fs3), 0);
    722         if (rc) {
    723           Dos_Error(MB_ENTER, rc, HWND_DESKTOP, pszSrcFile, __LINE__,
    724                       GetPString(IDS_INIREADONLYTEXT), inipath);
    725           }
    726 
     716      if (!CheckFileHeader(inipath, "\xff\xff\xff\xff\x14\x00\x00\x00", 0L)) {
     717        saymsg(MB_ENTER,HWND_DESKTOP,DEBUG_STRING,
     718               "Check INI header failed will attempt to replace with backup \\
     719               if backup fails or not found will open with new ini");
     720        DosCopy("FM3.INI", "FM3INI.BAD", DCPY_EXISTING);
     721        DosCopy("FM3INI.BAK", "FM3.INI", DCPY_EXISTING);
     722        if (!CheckFileHeader(inipath, "\xff\xff\xff\xff\x14\x00\x00\x00", 0L)) {
     723          DosCopy("FM3.INI", "FM3INI2.BAD", DCPY_EXISTING);
     724          fWantFirstTimeInit = TRUE;
     725        }
    727726      }
    728     }
    729 
     727      if (!fWantFirstTimeInit) {
     728        fIniExisted = TRUE;
     729        if (fs3.attrFile & (FILE_READONLY | FILE_HIDDEN | FILE_SYSTEM)) {
     730          fs3.attrFile &= ~(FILE_READONLY | FILE_HIDDEN | FILE_SYSTEM);
     731          rc = xDosSetPathInfo(inipath, FIL_STANDARD, &fs3, sizeof(fs3), 0);
     732          if (rc) {
     733            Dos_Error(MB_ENTER, rc, HWND_DESKTOP, pszSrcFile, __LINE__,
     734                        GetPString(IDS_INIREADONLYTEXT), inipath);
     735          }
     736        }
     737      }
     738    }
    730739    fmprof = PrfOpenProfile((HAB)0, inipath);
    731740    if (!fmprof) {
     
    738747    if (!fmprof) {
    739748      Win_Error(NULLHANDLE, NULLHANDLE, pszSrcFile, __LINE__,
    740                 "PrfOpenProfile");
     749                "PrfOpenProfile");
    741750      return FALSE;
    742751    }
Note: See TracChangeset for help on using the changeset viewer.