Changeset 1074 for trunk/dll/init.c


Ignore:
Timestamp:
Jul 18, 2008, 4:43:32 AM (17 years ago)
Author:
Steven Levine
Message:

Reduce code bulk in fUseTmp setup

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/dll/init.c

    r1073 r1074  
    4949                all the details view settings (both the global variables and those in the
    5050                DIRCNRDATA struct) into a new struct: DETAILS_SETTINGS.
     51  17 Jul 08 SHL Reduce code bulk in fUseTmp setup
    5152
    5253***********************************************************************/
     
    657658  /* set up default root names for temp archive goodies */
    658659  env = getenv("TMP");
     660  if (env == NULL)
     661    env = getenv("TEMP");
    659662  if (env != NULL) {
    660663    DosError(FERR_DISABLEHARDERR);
     
    662665    if (!rc) {
    663666      if (fs3.attrFile & FILE_DIRECTORY) {
     667        // 17 Jul 08 SHL fixme to check writable someday
    664668        BldFullPathName(ArcTempRoot, env, fAmAV2 ? "$AV$ARC$" : "$FM$ARC$");
    665669        pTmpDir = xstrdup(env, pszSrcFile, __LINE__);
    666670        fUseTmp = TRUE;
    667       }
    668     }
    669   }
    670   else {
    671     env = getenv("TEMP");
    672     if (env != NULL) {
    673       DosError(FERR_DISABLEHARDERR);
    674       rc = DosQueryPathInfo(env, FIL_STANDARD, &fs3, sizeof(fs3));
    675       if (!rc) {
    676         if (fs3.attrFile & FILE_DIRECTORY) {
    677           BldFullPathName(ArcTempRoot, env, fAmAV2 ? "$AV$ARC$" : "$FM$ARC$");
    678           pTmpDir = xstrdup(env, pszSrcFile, __LINE__);
    679           fUseTmp = TRUE;
    680         }
    681671      }
    682672    }
Note: See TracChangeset for help on using the changeset viewer.