Changeset 1915


Ignore:
Timestamp:
Nov 1, 2025, 7:27:49 PM (36 hours ago)
Author:
Gregg Young
Message:

Improve readability of insert_filename (use 0,1,2 instead of FALSE, TRUE,2 for loadit). Fix it so pszIDrive is only set from lastfilename if filename is NULL.

Location:
trunk/dll
Files:
9 edited

Legend:

Unmodified
Added
Removed
  • trunk/dll/collect.c

    r1878 r1915  
    10011001              memmove(pp, p, strlen(p) + 1);
    10021002          }
    1003           if (insert_filename(hwnd, filename, FALSE, FALSE))
     1003          if (insert_filename(hwnd, filename, 0, FALSE))
    10041004            SelectList(dcd->hwndCnr, TRUE, FALSE, FALSE, NULL, filename,
    10051005                       NULL);
     
    18181818              memmove(pp, p, strlen(p) + 1);
    18191819          }
    1820           if (insert_filename(hwnd, filename, FALSE, FALSE)) {
     1820          if (insert_filename(hwnd, filename, 0, FALSE)) {
    18211821#           ifdef FORTIFY
    18221822            Fortify_EnterScope();
  • trunk/dll/comp.c

    r1900 r1915  
    153153#include "worker.h"                     // MOVEIT
    154154#include "rename.h"                     // RenameProc
     155#include "eas.h"                        // GetLargeEASize
    155156
    156157#ifdef PMPRINTF
     
    216217                    pffb->ftimeLastWrite.minutes,
    217218                    pffb->ftimeLastWrite.twosecs,
    218                     pffb->attrFile,
    219                     pffb->cbList > 4 ? pffb->cbList / 2 : 0);
     219                    pffb->attrFile,
     220                    pffb->cbList == 65535 ? GetLargeEASize(pffb->achName) : CBLIST_TO_EASIZE(pffb->cbList));
    220221          }
    221222          // Skip . and ..
     
    18391840                                      p = strchr(p, ',');
    18401841                                      if (p) {
    1841                                         p++;
    1842                                         fb4.cbList = atol(p) * 2;
     1842                                        p++;
     1843                                        //Since cbList is a ulong and will always be even the fact they can exceed
     1844                                        //65535 doesn't matter. 31 Oct 25 GKY
     1845                                        fb4.cbList = atol(p) * 2;
    18431846                                        if (fForceUpper)
    18441847                                          strupr(str + 1);
     
    24262429
    24272430        strcpy(fullname, PCSZ_STARDOTPMD);
    2428         if (insert_filename(HWND_DESKTOP, fullname, TRUE, FALSE) &&
     2431        if (insert_filename(HWND_DESKTOP, fullname, 1, FALSE) &&
    24292432            *fullname && !strchr(fullname, '*') && !strchr(fullname, '?'))
    24302433          strcpy(cmp->rightlist, fullname);
     
    32193222
    32203223        strcpy(fullname, PCSZ_STARDOTPMD);
    3221         if (insert_filename(HWND_DESKTOP, fullname, TRUE, FALSE) &&
     3224        if (insert_filename(HWND_DESKTOP, fullname, 1, FALSE) &&
    32223225            *fullname && !strchr(fullname, '*') && !strchr(fullname, '?')) {
    32233226          strcpy(cmp->rightlist, fullname);
     
    32873290
    32883291            strcpy(fullname, PCSZ_STARDOTPMD);
    3289             if (insert_filename(HWND_DESKTOP, fullname, TRUE, FALSE) &&
     3292            if (insert_filename(HWND_DESKTOP, fullname, 1, FALSE) &&
    32903293                *fullname && !strchr(fullname, '*') && !strchr(fullname, '?'))
    32913294              strcpy(cmp->rightlist, fullname);
  • trunk/dll/dircnrs.c

    r1899 r1915  
    10711071              memmove(pp, p, strlen(p) + 1);
    10721072          }
    1073           if (insert_filename(hwnd, filename, FALSE, FALSE))
     1073          if (insert_filename(hwnd, filename, 0, FALSE))
    10741074            SelectList(dcd->hwndCnr, TRUE, FALSE, FALSE, NULL, filename,
    10751075                       NULL);
  • trunk/dll/eas.c

    r1877 r1915  
    828828
    829829        if (list) {
    830           if (insert_filename(HWND_DESKTOP,filename,TRUE,FALSE) &&
     830          if (insert_filename(HWND_DESKTOP,filename,1,FALSE) &&
    831831              *filename && *filename != '*') {
    832832            list[0] = filename;
     
    14881488  DosPostEventSem(CompactSem);
    14891489}
    1490 
    14911490#pragma alloc_text(EAS,DisplayEAsProc,SaveEA,HexDumpEA,CheckEA,AddEAProc)
    1492 #pragma alloc_text(EAS1,HexDump,GetFileEAs,Free_FEAList)
    1493 
     1491#pragma alloc_text(EAS1,HexDump,GetFileEAs,Free_FEAList,GetLargeEASize)
     1492
  • trunk/dll/getnames.c

    r1880 r1915  
    233233  fdlg.cbSize = (ULONG) sizeof(FILEDLG);
    234234  fdlg.fl = FDS_CENTER | FDS_OPEN_DIALOG;
    235   if (!loadit) {
     235  if (loadit == 0) {
    236236    fdlg.pszTitle = (PSZ)GetPString(IDS_ENTERFILEINSERTTEXT);
    237237    fdlg.pszOKButton = (PSZ)GetPString(IDS_INSERTTEXT);
    238238  }
    239   else if (loadit == TRUE) {
     239  else if (loadit == 1) {
    240240    fdlg.pszTitle = (PSZ)GetPString(IDS_ENTERFILELOADTEXT);
    241241    fdlg.pszOKButton = (PSZ)GetPString(IDS_LOADTEXT);
     
    251251    fdlg.pszIDrive = pdrive;
    252252  }
    253   else if (*lastfilename) {
     253  else if (!*filename && *lastfilename) {
    254254    *drive = *lastfilename;
    255255    drive[1] = ':';
     
    267267      }
    268268    }
    269     if (!loadit || loadit == TRUE)
     269    if (loadit < 2)
    270270      strcat(fdlg.szFullFile, PCSZ_STARDOTTXT);
    271271    else
     
    341341    fdlg.pszIDrive = pdrive;
    342342  }
    343   else if (*lastfilename) {
     343  else if (!*filename && *lastfilename) {
    344344    *drive = *lastfilename;
    345345    drive[1] = ':';
  • trunk/dll/inis.c

    r1880 r1915  
    10171017          *filename = 0;
    10181018        strcat(filename, PCSZ_STARDOTINI);
    1019         if (insert_filename(hwnd, filename, TRUE, FALSE) && *filename)
     1019        if (insert_filename(hwnd, filename, 1, FALSE) && *filename)
    10201020          WinSetDlgItemText(hwnd, id, filename);
    10211021      }
     
    11211121          *filename = 0;
    11221122        strcat(filename, PCSZ_STARDOTINI);
    1123         if (insert_filename(hwnd, filename, TRUE, FALSE) && *filename)
     1123        if (insert_filename(hwnd, filename, 1, FALSE) && *filename)
    11241124          WinSetDlgItemText(hwnd, id, filename);
    11251125      }
     
    26532653        if (insert_filename(hwnd,
    26542654                            filename,
    2655                             TRUE,
     2655                            1,
    26562656                            TRUE) &&
    26572657            *filename &&
  • trunk/dll/shadow.c

    r1811 r1915  
    113113  if (!PrfQueryProfileString(fmprof, appname, "JavaExe", NULL, javaexe, CCHMAXPATH - 1)) {
    114114    strcpy(javaexe, PCSZ_STARDOTEXE);
    115     if (insert_filename(HWND_DESKTOP, javaexe, TRUE, FALSE) &&
     115    if (insert_filename(HWND_DESKTOP, javaexe, 1, FALSE) &&
    116116        *javaexe && !strchr(javaexe, '*') && !strchr(javaexe, '?'))
    117117      PrfWriteProfileString(fmprof, appname, "JavaExe", javaexe);
     
    125125  strcpy(icon, path);
    126126  strcat(icon, "\\*.ico");
    127   insert_filename(HWND_DESKTOP, icon, TRUE, FALSE);
     127  insert_filename(HWND_DESKTOP, icon, 1, FALSE);
    128128  obj = WinCreateObject((CHAR *) WPProgram,
    129129                        objecttmp,
  • trunk/dll/viewer.c

    r1893 r1915  
    958958                            filename,
    959959                            (SHORT1FROMMP(mp1) == MLE_INSERTFILE) ?
    960                             FALSE : TRUE, FALSE)) {
     960                            0 : 1, FALSE)) {
    961961          strcpy(vw->importfilename, filename);
    962962          if (SHORT1FROMMP(mp1) == MLE_INSERTFILE)
  • trunk/dll/worker.c

    r1880 r1915  
    15661566
    15671567            strcpy(javaexe, PCSZ_STARDOTEXE);
    1568             if (insert_filename(HWND_DESKTOP, javaexe, TRUE, FALSE) &&
     1568            if (insert_filename(HWND_DESKTOP, javaexe, 1, FALSE) &&
    15691569                *javaexe && !strchr(javaexe, '*') && !strchr(javaexe, '?'))
    15701570              PrfWriteProfileString(fmprof, appname, "JavaExe", javaexe);
Note: See TracChangeset for help on using the changeset viewer.