Changeset 1438 for trunk/dll/copyf.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/copyf.c

    r1402 r1438  
    2121  19 Jul 08 GKY Modify MakeTempName for use making temp directory names
    2222  08 Mar 09 GKY Removed variable aurguments from docopyf and unlinkf (not used)
     23  28 Jun 09 GKY Added AddBackslashToPath() to remove repeatative code.
    2324
    2425***********************************************************************/
     
    5051#include "wrappers.h"                   // xDosSetPathInfo
    5152#include "strips.h"                     // bstrip
    52 #include "fortify.h"
     53#include "fortify.h"                   
     54#include "pathutil.h"                   // AddBackslashToPath
    5355
    5456static PSZ pszSrcFile = __FILE__;
     
    7577  char *p, *o;
    7678
    77   if (strlen(buffer) > 3 && buffer[strlen(buffer) - 1] != '\\')
    78     strcat(buffer, "\\");
     79
     80  if (strlen(buffer) > 3) // && buffer[strlen(buffer) - 1] != '\\')
     81    AddBackslashToPath(buffer);
     82    //strcat(buffer, "\\");
    7983  p = o = buffer + strlen(buffer);
    8084  switch (type) {
     
    282286BOOL ZapLongName(char *filename)
    283287{
    284   return WriteLongName(filename, "");
     288  return WriteLongName(filename, NullStr);
    285289}
    286290
     
    308312  else
    309313    ealen = sizeof(FEALIST) + 10;
    310   rc = DosAllocMem((PPVOID) & pfealist,
    311                    ealen + 32L, OBJ_TILE | PAG_COMMIT | PAG_READ | PAG_WRITE);
     314  rc = xDosAllocMem((PPVOID) & pfealist,
     315                    ealen + 32L, OBJ_TILE | PAG_COMMIT | PAG_READ | PAG_WRITE);
    312316  if (rc)
    313317    Dos_Error(MB_CANCEL, rc, HWND_DESKTOP, pszSrcFile, __LINE__,
     
    536540      if (IsFile(newname) != -1 && stricmp(oldname, newname)) {
    537541        strcpy(dir, newname);
    538         p = strrchr(dir, '\\');
    539         if (p)
    540           *p = 0;
    541         strcat(dir, "\\");
     542        AddBackslashToPath(dir);
     543        //p = strrchr(dir, '\\');
     544        //if (p)
     545        //  *p = 0;
     546        //strcat(dir, "\\");
    542547        MakeTempName(dir, NULL, 0);
    543548        if (DosMove(newname, dir))
Note: See TracChangeset for help on using the changeset viewer.