Changeset 1345 for trunk/dll/command.c


Ignore:
Timestamp:
Dec 19, 2008, 8:23:07 PM (17 years ago)
Author:
Gregg Young
Message:

Code cleanup address some fixmes in command.c; lengthen the command title field

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/dll/command.c

    r1337 r1345  
    6666  PSZ pszCmdLine;
    6767  INT flags;
    68   CHAR title[34];
     68  CHAR title[100];
    6969}
    7070COMMAND;
     
    345345  PSZ pszCmdLine;
    346346  CHAR title[100];
    347   CHAR flags[72];
     347  CHAR flags[34];
    348348
    349349  if (cmdhead)
     
    358358        if (!xfgets_bstripcr(title, sizeof(title), fp, pszSrcFile, __LINE__))
    359359          break;
    360         title[34] = 0;                  // fixme to know why chopped this way?
    361         bstripcr(title);
     360        title[strlen(title)] = 0;                       // Match size to entry file max
    362361        if (!*title || *title == ';')
    363362          continue;
    364         if (!xfgets(pszCmdLine, MaxComLineStrg, fp, pszSrcFile, __LINE__))
     363        if (!xfgets_bstripcr(pszCmdLine, MaxComLineStrg, fp, pszSrcFile, __LINE__))
    365364          break;                                /* error! */
    366         if (!xfgets(flags, 72, fp, pszSrcFile, __LINE__))
     365        if (!xfgets_bstripcr(flags, sizeof(flags), fp, pszSrcFile, __LINE__))
    367366          break;                                /* error! */
    368         pszCmdLine[MaxComLineStrg - 1] = 0;                     // fixme to know why chopped this way?
    369         bstripcr(pszCmdLine);
     367        pszCmdLine[strlen(pszCmdLine)] = 0;                     // fixme to know why chopped this way?
     368        //bstripcr(pszCmdLine);
    370369        flags[34] = 0;
    371         bstripcr(flags);
     370        //bstripcr(flags);
    372371        if (!pszCmdLine)
    373372          continue;
     
    426425    while (info) {
    427426      fprintf(fp,
    428               ";\n%0.34s\n%0.*s\n%lu\n",
     427              ";\n%0.99s\n%0.*s\n%lu\n",
    429428              info->title, MaxComLineStrg, info->pszCmdLine, info->flags);
    430429      info = info->next;
     
    513512    WinSendDlgItemMsg(hwnd, CMD_LISTBOX, LM_DELETEALL, MPVOID, MPVOID);
    514513    WinSendDlgItemMsg(hwnd, CMD_CL, EM_SETTEXTLIMIT,
    515                       MPFROM2SHORT(1000, 0), MPVOID);
     514                      MPFROM2SHORT(MaxComLineStrg - 1, 0), MPVOID);
    516515    WinSendDlgItemMsg(hwnd, CMD_TITLE, EM_SETTEXTLIMIT,
    517                       MPFROM2SHORT(33, 0), MPVOID);
     516                      MPFROM2SHORT(99, 0), MPVOID);
    518517    WinSetDlgItemText(hwnd, CMD_CL, NullStr);
    519518    WinSetDlgItemText(hwnd, CMD_TITLE, NullStr);
     
    844843    case CMD_DELETE:
    845844      {
    846         CHAR temp[34];
    847 
    848         WinQueryDlgItemText(hwnd, CMD_TITLE, 34, temp);
     845        CHAR temp[100];
     846
     847        WinQueryDlgItemText(hwnd, CMD_TITLE, 100, temp);
    849848        bstrip(temp);
    850849        if (!kill_command(temp))
Note: See TracChangeset for help on using the changeset viewer.