Changeset 1438 for trunk/dll/walkem.c


Ignore:
Timestamp:
Jun 28, 2009, 10:47:00 PM (16 years ago)
Author:
Gregg Young
Message:

Improved drivebar changes; Added AddBackslashToPath() to remove repeatative code. replaced "
" with PCSZ variable; ANY_OBJ added the DosAlloc... (experimental)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/dll/walkem.c

    r1402 r1438  
    3434  19 Jul 08 GKY Replace save_dir2(dir) with pFM2SaveDirectory and use BldFullPathName
    3535  24 Aug 08 GKY Warn full drive on save of .DAT file; prevent loss of existing file
     36  28 Jun 09 GKY Added AddBackslashToPath() to remove repeatative code.
    3637
    3738***********************************************************************/
     
    681682    sprintf(szTemp,
    682683            "%s%s*",
    683             pszPath, (pszPath[strlen(pszPath) - 1] == '\\') ? "" : "\\");
     684            pszPath, (pszPath[strlen(pszPath) - 1] == '\\') ? NullStr : PCSZ_BACKSLASH);
    684685    DosError(FERR_DISABLEHARDERR);
    685686    if (!DosFindFirst(szTemp,
     
    11461147        bstrip(szBuffer);
    11471148        if (*szBuffer) {
    1148           strcpy(szBuff, wa->szCurrentPath);
    1149           if (szBuff[strlen(szBuff) - 1] != '\\')
    1150             strcat(szBuff, "\\");
     1149          strcpy(szBuff, wa->szCurrentPath);
     1150          AddBackslashToPath(szBuff);
     1151          //if (szBuff[strlen(szBuff) - 1] != '\\')
     1152          //  strcat(szBuff, "\\");
    11511153          strcat(szBuff, szBuffer);
    11521154          MakeFullName(szBuff);
     
    15391541        bstrip(szBuffer);
    15401542        if (*szBuffer) {
    1541           strcpy(szBuff, wa->szCurrentPath1);
    1542           if (szBuff[strlen(szBuff) - 1] != '\\')
    1543             strcat(szBuff, "\\");
     1543          strcpy(szBuff, wa->szCurrentPath1);
     1544          AddBackslashToPath(szBuff);
     1545          //if (szBuff[strlen(szBuff) - 1] != '\\')
     1546          //  strcat(szBuff, "\\");
    15441547          strcat(szBuff, szBuffer);
    15451548          MakeFullName(szBuff);
     
    16041607        bstrip(szBuffer);
    16051608        if (*szBuffer) {
    1606           strcpy(szBuff, wa->szCurrentPath2);
    1607           if (szBuff[strlen(szBuff) - 1] != '\\')
    1608             strcat(szBuff, "\\");
     1609          strcpy(szBuff, wa->szCurrentPath2);
     1610          AddBackslashToPath(szBuff);
     1611          //if (szBuff[strlen(szBuff) - 1] != '\\')
     1612          //  strcat(szBuff, "\\");
    16091613          strcat(szBuff, szBuffer);
    16101614          MakeFullName(szBuff);
Note: See TracChangeset for help on using the changeset viewer.