2000-02-01 18:29:11 +00:00
|
|
|
/*
|
1999-03-20 20:28:42 +00:00
|
|
|
* HISTORY.C - command line history.
|
|
|
|
*
|
|
|
|
*
|
|
|
|
* History:
|
|
|
|
*
|
|
|
|
* 14/01/95 (Tim Norman)
|
|
|
|
* started.
|
|
|
|
*
|
|
|
|
* 08/08/95 (Matt Rains)
|
|
|
|
* i have cleaned up the source code. changes now bring this source
|
|
|
|
* into guidelines for recommended programming practice.
|
|
|
|
*
|
|
|
|
* 27-Jul-1998 (John P Price <linux-guru@gcfl.net>)
|
|
|
|
* added config.h include
|
|
|
|
*
|
|
|
|
* 25-Jan-1999 (Eric Kohl <ekohl@abo.rhein-zeitung.de>)
|
|
|
|
* Cleanup!
|
|
|
|
* Unicode and redirection safe!
|
1999-12-06 19:26:49 +00:00
|
|
|
*
|
|
|
|
* 25-Jan-1999 (Paolo Pantaleo <paolopan@freemail.it>)
|
|
|
|
* Added lots of comments (beginning studying the source)
|
|
|
|
* Added command.com's F3 support (see cmdinput.c)
|
|
|
|
*
|
1999-03-20 20:28:42 +00:00
|
|
|
*/
|
|
|
|
|
2000-02-01 18:29:11 +00:00
|
|
|
|
|
|
|
|
1999-12-06 19:26:49 +00:00
|
|
|
/*
|
|
|
|
* HISTORY.C - command line history. Second version
|
|
|
|
*
|
|
|
|
*
|
|
|
|
* History:
|
|
|
|
*
|
|
|
|
* 06/12/99 (Paolo Pantaleo <paolopan@freemail.it>)
|
|
|
|
* started.
|
|
|
|
*
|
2000-02-01 18:29:11 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1999-12-07 18:17:17 +00:00
|
|
|
|
1999-03-20 20:28:42 +00:00
|
|
|
#include "config.h"
|
|
|
|
|
2000-02-01 18:29:11 +00:00
|
|
|
|
1999-03-20 20:28:42 +00:00
|
|
|
#ifdef FEATURE_HISTORY
|
2000-02-01 18:29:11 +00:00
|
|
|
|
1999-03-20 20:28:42 +00:00
|
|
|
#include <windows.h>
|
|
|
|
#include <tchar.h>
|
|
|
|
#include <string.h>
|
|
|
|
#include <stdlib.h>
|
2000-02-18 00:53:11 +00:00
|
|
|
#include <ctype.h>
|
1999-03-20 20:28:42 +00:00
|
|
|
|
1999-05-11 12:40:11 +00:00
|
|
|
#include "cmd.h"
|
1999-03-20 20:28:42 +00:00
|
|
|
|
|
|
|
|
1999-12-06 19:26:49 +00:00
|
|
|
typedef struct tagHISTORY
|
|
|
|
{
|
|
|
|
struct tagHISTORY *prev;
|
|
|
|
struct tagHISTORY *next;
|
|
|
|
LPTSTR string;
|
|
|
|
} HIST_ENTRY, * LPHIST_ENTRY;
|
|
|
|
|
2000-02-01 18:29:11 +00:00
|
|
|
static INT size,
|
|
|
|
max_size=100;
|
|
|
|
|
|
|
|
|
1999-12-06 19:26:49 +00:00
|
|
|
|
|
|
|
static LPHIST_ENTRY Top;
|
|
|
|
static LPHIST_ENTRY Bottom;
|
2000-02-01 18:29:11 +00:00
|
|
|
|
|
|
|
|
1999-12-06 19:26:49 +00:00
|
|
|
static LPHIST_ENTRY curr_ptr=0;
|
|
|
|
|
2000-02-01 18:29:11 +00:00
|
|
|
|
|
|
|
VOID InitHistory(VOID);
|
|
|
|
VOID History_move_to_bottom(VOID);
|
|
|
|
VOID History (INT dir, LPTSTR commandline);
|
|
|
|
VOID CleanHistory(VOID);
|
|
|
|
VOID History_del_current_entry(LPTSTR str);
|
|
|
|
|
|
|
|
/*service functions*/
|
2000-02-18 00:53:11 +00:00
|
|
|
static VOID del(LPHIST_ENTRY item);
|
|
|
|
static VOID add_at_bottom(LPTSTR string);
|
2000-02-01 18:29:11 +00:00
|
|
|
/*VOID add_before_last(LPTSTR string);*/
|
|
|
|
VOID set_size(INT new_size);
|
1999-12-07 18:17:17 +00:00
|
|
|
|
|
|
|
|
2000-02-01 18:29:11 +00:00
|
|
|
|
|
|
|
INT CommandHistory (LPTSTR cmd, LPTSTR param)
|
1999-12-06 19:26:49 +00:00
|
|
|
{
|
2000-02-01 18:29:11 +00:00
|
|
|
LPTSTR tmp;
|
|
|
|
INT tmp_int;
|
|
|
|
LPHIST_ENTRY h_tmp;
|
|
|
|
TCHAR szBuffer[2048];
|
|
|
|
|
|
|
|
tmp=_tcschr(param,_T('/'));
|
|
|
|
|
|
|
|
if (tmp)
|
|
|
|
{
|
|
|
|
param=tmp;
|
|
|
|
switch (_totupper(param[1]))
|
|
|
|
{
|
|
|
|
case _T('F'):/*delete history*/
|
|
|
|
CleanHistory();InitHistory();
|
|
|
|
break;
|
2000-02-18 00:53:11 +00:00
|
|
|
|
2000-02-01 18:29:11 +00:00
|
|
|
case _T('R'):/*read history from standard in*/
|
|
|
|
//hIn=GetStdHandle (STD_INPUT_HANDLE);
|
|
|
|
|
|
|
|
for(;;)
|
|
|
|
{
|
|
|
|
ConInString(szBuffer,sizeof(szBuffer)/sizeof(TCHAR));
|
|
|
|
if (*szBuffer!=_T('\0'))
|
|
|
|
History(0,szBuffer);
|
|
|
|
else
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
break;
|
2000-02-18 00:53:11 +00:00
|
|
|
|
2000-02-01 18:29:11 +00:00
|
|
|
case _T('A'):/*add an antry*/
|
|
|
|
History(0,param+2);
|
|
|
|
break;
|
2000-02-18 00:53:11 +00:00
|
|
|
|
2000-02-01 18:29:11 +00:00
|
|
|
case _T('S'):/*set history size*/
|
2000-02-18 00:53:11 +00:00
|
|
|
if ((tmp_int=_ttoi(param+2)))
|
2000-02-01 18:29:11 +00:00
|
|
|
set_size(tmp_int);
|
|
|
|
break;
|
2000-02-18 00:53:11 +00:00
|
|
|
|
2000-02-01 18:29:11 +00:00
|
|
|
default:
|
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
for(h_tmp=Top->prev;h_tmp!=Bottom;h_tmp=h_tmp->prev)
|
|
|
|
ConErrPuts(h_tmp->string);
|
|
|
|
}
|
2000-02-18 00:53:11 +00:00
|
|
|
return 0;
|
2000-02-01 18:29:11 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
VOID set_size(INT new_size)
|
|
|
|
{
|
|
|
|
|
|
|
|
while(new_size<size)
|
|
|
|
del(Top->prev);
|
|
|
|
|
|
|
|
|
|
|
|
max_size=new_size;
|
|
|
|
}
|
|
|
|
|
1999-12-06 19:26:49 +00:00
|
|
|
|
2000-02-01 18:29:11 +00:00
|
|
|
VOID InitHistory(VOID)
|
|
|
|
{
|
|
|
|
size=0;
|
|
|
|
|
|
|
|
|
1999-12-24 17:20:54 +00:00
|
|
|
Top = malloc(sizeof(HIST_ENTRY));
|
2000-02-01 18:29:11 +00:00
|
|
|
Bottom = malloc(sizeof(HIST_ENTRY));
|
|
|
|
|
1999-12-06 19:26:49 +00:00
|
|
|
|
|
|
|
Top->prev = Bottom;
|
|
|
|
Top->next = NULL;
|
|
|
|
Top->string = NULL;
|
|
|
|
|
2000-02-01 18:29:11 +00:00
|
|
|
|
1999-12-06 19:26:49 +00:00
|
|
|
Bottom->prev = NULL;
|
2000-02-01 18:29:11 +00:00
|
|
|
Bottom->next = Top;
|
1999-12-06 19:26:49 +00:00
|
|
|
Bottom->string = NULL;
|
|
|
|
|
|
|
|
curr_ptr=Bottom;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2000-02-01 18:29:11 +00:00
|
|
|
|
|
|
|
|
|
|
|
VOID CleanHistory(VOID)
|
1999-12-07 18:17:17 +00:00
|
|
|
{
|
2000-02-01 18:29:11 +00:00
|
|
|
|
1999-12-07 18:17:17 +00:00
|
|
|
while (Bottom->next!=Top)
|
2000-02-01 18:29:11 +00:00
|
|
|
del(Bottom->next);
|
|
|
|
|
|
|
|
free(Top);
|
|
|
|
free(Bottom);
|
1999-12-07 18:17:17 +00:00
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
1999-12-09 19:20:47 +00:00
|
|
|
VOID History_del_current_entry(LPTSTR str)
|
|
|
|
{
|
|
|
|
LPHIST_ENTRY tmp;
|
2000-02-01 18:29:11 +00:00
|
|
|
|
1999-12-09 19:20:47 +00:00
|
|
|
if (size==0)
|
|
|
|
return;
|
|
|
|
|
|
|
|
if(curr_ptr==Bottom)
|
|
|
|
curr_ptr=Bottom->next;
|
|
|
|
|
|
|
|
if(curr_ptr==Top)
|
|
|
|
curr_ptr=Top->prev;
|
|
|
|
|
2000-02-01 18:29:11 +00:00
|
|
|
|
|
|
|
tmp=curr_ptr;
|
1999-12-09 19:20:47 +00:00
|
|
|
curr_ptr=curr_ptr->prev;
|
|
|
|
del(tmp);
|
|
|
|
History(-1,str);
|
2000-02-01 18:29:11 +00:00
|
|
|
|
1999-12-09 19:20:47 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
1999-12-06 19:26:49 +00:00
|
|
|
static
|
|
|
|
VOID del(LPHIST_ENTRY item)
|
|
|
|
{
|
2000-02-01 18:29:11 +00:00
|
|
|
|
1999-12-09 19:20:47 +00:00
|
|
|
if( item==NULL || item==Top || item==Bottom )
|
|
|
|
{
|
|
|
|
#ifdef _DEBUG
|
|
|
|
DebugPrintf("del in " __FILE__ ": retrning\n"
|
|
|
|
"item is 0x%08x (Bottom is0x%08x)\n",
|
2000-02-01 18:29:11 +00:00
|
|
|
item, Bottom);
|
|
|
|
|
1999-12-09 19:20:47 +00:00
|
|
|
#endif
|
1999-12-06 19:26:49 +00:00
|
|
|
return;
|
1999-12-09 19:20:47 +00:00
|
|
|
}
|
|
|
|
|
2000-02-01 18:29:11 +00:00
|
|
|
|
|
|
|
|
1999-12-07 18:17:17 +00:00
|
|
|
/*free string's mem*/
|
|
|
|
if (item->string)
|
|
|
|
free(item->string);
|
2000-02-01 18:29:11 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1999-12-06 19:26:49 +00:00
|
|
|
|
|
|
|
/*set links in prev and next item*/
|
|
|
|
item->next->prev=item->prev;
|
2000-02-01 18:29:11 +00:00
|
|
|
item->prev->next=item->next;
|
1999-12-06 19:26:49 +00:00
|
|
|
|
|
|
|
free(item);
|
|
|
|
|
|
|
|
size--;
|
2000-02-01 18:29:11 +00:00
|
|
|
|
1999-12-06 19:26:49 +00:00
|
|
|
}
|
|
|
|
|
2000-02-01 18:29:11 +00:00
|
|
|
#if 0
|
|
|
|
static
|
|
|
|
VOID add_before_last(LPTSTR string)
|
|
|
|
{
|
|
|
|
|
|
|
|
LPHIST_ENTRY tmp,before,after;
|
|
|
|
|
|
|
|
|
|
|
|
/*delete first entry if maximum number of entries is reached*/
|
|
|
|
while(size>=max_size)
|
|
|
|
del(Top->prev);
|
|
|
|
|
|
|
|
while (_istspace(*string))
|
|
|
|
string++;
|
|
|
|
|
|
|
|
if (*string==_T('\0'))
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/*allocte entry and string*/
|
|
|
|
tmp=malloc(sizeof(HIST_ENTRY));
|
|
|
|
tmp->string=malloc(_tcslen(string)+1);
|
|
|
|
_tcscpy(tmp->string,string);
|
|
|
|
|
|
|
|
|
|
|
|
/*set links*/
|
|
|
|
before=Bottom->next;
|
|
|
|
after=before->next;
|
|
|
|
|
|
|
|
tmp->prev=before;
|
|
|
|
tmp->next=after;
|
|
|
|
|
|
|
|
after->prev=tmp;
|
|
|
|
before->next=tmp;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/*set new size*/
|
|
|
|
size++;
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
#endif/*0*/
|
1999-12-06 19:26:49 +00:00
|
|
|
|
|
|
|
static
|
|
|
|
VOID add_at_bottom(LPTSTR string)
|
2000-02-01 18:29:11 +00:00
|
|
|
{
|
|
|
|
|
|
|
|
|
1999-12-24 17:20:54 +00:00
|
|
|
LPHIST_ENTRY tmp;
|
1999-12-06 19:26:49 +00:00
|
|
|
|
2000-02-01 18:29:11 +00:00
|
|
|
|
1999-12-24 17:20:54 +00:00
|
|
|
/*delete first entry if maximum number of entries is reached*/
|
2000-02-01 18:29:11 +00:00
|
|
|
while(size>=max_size)
|
1999-12-24 17:20:54 +00:00
|
|
|
del(Top->prev);
|
1999-12-06 19:26:49 +00:00
|
|
|
|
2000-02-01 18:29:11 +00:00
|
|
|
while (_istspace(*string))
|
|
|
|
string++;
|
|
|
|
|
|
|
|
if (*string==_T('\0'))
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
|
|
/*if new entry is the same than the last do not add it*/
|
|
|
|
if(size)
|
|
|
|
if(_tcscmp(string,Bottom->next->string)==0)
|
|
|
|
return;
|
1999-12-06 19:26:49 +00:00
|
|
|
|
2000-02-01 18:29:11 +00:00
|
|
|
|
|
|
|
/*fill bottom with string, it will become Bottom->next*/
|
|
|
|
Bottom->string=malloc(_tcslen(string)+1);
|
|
|
|
_tcscpy(Bottom->string,string);
|
|
|
|
|
1999-12-24 17:20:54 +00:00
|
|
|
/*save Bottom value*/
|
|
|
|
tmp=Bottom;
|
1999-12-06 19:26:49 +00:00
|
|
|
|
2000-02-01 18:29:11 +00:00
|
|
|
|
1999-12-24 17:20:54 +00:00
|
|
|
/*create new void Bottom*/
|
2000-02-01 18:29:11 +00:00
|
|
|
Bottom=malloc(sizeof(HIST_ENTRY));
|
1999-12-24 17:20:54 +00:00
|
|
|
Bottom->next=tmp;
|
|
|
|
Bottom->prev=NULL;
|
|
|
|
Bottom->string=NULL;
|
1999-12-06 19:26:49 +00:00
|
|
|
|
1999-12-24 17:20:54 +00:00
|
|
|
tmp->prev=Bottom;
|
1999-12-06 19:26:49 +00:00
|
|
|
|
1999-12-24 17:20:54 +00:00
|
|
|
/*set new size*/
|
|
|
|
size++;
|
2000-02-01 18:29:11 +00:00
|
|
|
|
1999-12-06 19:26:49 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2000-02-01 18:29:11 +00:00
|
|
|
|
1999-12-06 19:26:49 +00:00
|
|
|
VOID History_move_to_bottom(VOID)
|
|
|
|
{
|
|
|
|
curr_ptr=Bottom;
|
2000-02-01 18:29:11 +00:00
|
|
|
|
1999-12-06 19:26:49 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
VOID History (INT dir, LPTSTR commandline)
|
|
|
|
{
|
2000-02-01 18:29:11 +00:00
|
|
|
|
1999-12-06 19:26:49 +00:00
|
|
|
if(dir==0)
|
|
|
|
{
|
|
|
|
add_at_bottom(commandline);
|
|
|
|
curr_ptr=Bottom;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (size==0)
|
|
|
|
{
|
|
|
|
commandline[0]=_T('\0');
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2000-02-01 18:29:11 +00:00
|
|
|
|
1999-12-06 19:26:49 +00:00
|
|
|
if(dir<0)/*key up*/
|
|
|
|
{
|
1999-12-07 18:17:17 +00:00
|
|
|
if (curr_ptr->next==Top || curr_ptr==Top)
|
1999-12-06 19:26:49 +00:00
|
|
|
{
|
2000-02-01 18:29:11 +00:00
|
|
|
#ifdef WRAP_HISTORY
|
|
|
|
curr_ptr=Bottom;
|
|
|
|
#else
|
1999-12-06 19:26:49 +00:00
|
|
|
curr_ptr=Top;
|
|
|
|
commandline[0]=_T('\0');
|
|
|
|
return;
|
|
|
|
#endif
|
|
|
|
}
|
|
|
|
|
2000-02-01 18:29:11 +00:00
|
|
|
|
1999-12-06 19:26:49 +00:00
|
|
|
curr_ptr = curr_ptr->next;
|
|
|
|
if(curr_ptr->string)
|
|
|
|
_tcscpy(commandline,curr_ptr->string);
|
2000-02-01 18:29:11 +00:00
|
|
|
|
1999-12-06 19:26:49 +00:00
|
|
|
}
|
2000-02-01 18:29:11 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1999-12-06 19:26:49 +00:00
|
|
|
|
|
|
|
if(dir>0)
|
|
|
|
{
|
2000-02-01 18:29:11 +00:00
|
|
|
|
1999-12-07 18:17:17 +00:00
|
|
|
if (curr_ptr->prev==Bottom || curr_ptr==Bottom)
|
1999-12-06 19:26:49 +00:00
|
|
|
{
|
2000-02-01 18:29:11 +00:00
|
|
|
#ifdef WRAP_HISTORY
|
1999-12-06 19:26:49 +00:00
|
|
|
curr_ptr=Top;
|
|
|
|
#else
|
|
|
|
curr_ptr=Bottom;
|
|
|
|
commandline[0]=_T('\0');
|
|
|
|
return;
|
|
|
|
#endif
|
|
|
|
}
|
|
|
|
|
2000-02-01 18:29:11 +00:00
|
|
|
curr_ptr=curr_ptr->prev;
|
1999-12-06 19:26:49 +00:00
|
|
|
if(curr_ptr->string)
|
2000-02-01 18:29:11 +00:00
|
|
|
_tcscpy(commandline,curr_ptr->string);
|
|
|
|
|
1999-03-20 20:28:42 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2000-02-01 18:29:11 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#if 0
|
|
|
|
|
|
|
|
LPTSTR history = NULL; /*buffer to sotre all the lines*/
|
|
|
|
LPTSTR lines[MAXLINES]; /*array of pointers to each line(entry)*/
|
|
|
|
/*located in history buffer*/
|
|
|
|
|
|
|
|
INT curline = 0; /*the last line recalled by user*/
|
|
|
|
INT numlines = 0; /*number of entries, included the last*/
|
|
|
|
/*empty one*/
|
|
|
|
|
|
|
|
INT maxpos = 0; /*index of last byte of last entry*/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
VOID History (INT dir, LPTSTR commandline)
|
|
|
|
{
|
|
|
|
|
|
|
|
INT count; /*used in for loops*/
|
|
|
|
INT length; /*used in the same loops of count*/
|
|
|
|
/*both to make room when is full
|
|
|
|
either history or lines*/
|
|
|
|
|
|
|
|
/*first time History is called allocate mem*/
|
|
|
|
if (!history)
|
|
|
|
{
|
|
|
|
history = malloc (history_size * sizeof (TCHAR));
|
|
|
|
lines[0] = history;
|
|
|
|
history[0] = 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (dir > 0)
|
|
|
|
{
|
|
|
|
/* next command */
|
|
|
|
if (curline < numlines)
|
|
|
|
{
|
|
|
|
curline++;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (curline == numlines)
|
|
|
|
{
|
|
|
|
commandline[0] = 0;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
_tcscpy (commandline, lines[curline]);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else if (dir < 0)
|
|
|
|
{
|
|
|
|
/* prev command */
|
|
|
|
if (curline > 0)
|
|
|
|
{
|
|
|
|
curline--;
|
|
|
|
}
|
|
|
|
|
|
|
|
_tcscpy (commandline, lines[curline]);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
/* add to history */
|
|
|
|
/* remove oldest string until there's enough room for next one */
|
|
|
|
/* strlen (commandline) must be less than history_size! */
|
|
|
|
while ((maxpos + (INT)_tcslen (commandline) + 1 > history_size) || (numlines >= MAXLINES))
|
|
|
|
{
|
|
|
|
length = _tcslen (lines[0]) + 1;
|
|
|
|
|
|
|
|
for (count = 0; count < maxpos && count + (lines[1] - lines[0]) < history_size; count++)
|
|
|
|
{
|
|
|
|
history[count] = history[count + length];
|
|
|
|
}
|
|
|
|
|
|
|
|
maxpos -= length;
|
|
|
|
|
|
|
|
for (count = 0; count <= numlines && count < MAXLINES; count++)
|
|
|
|
{
|
|
|
|
lines[count] = lines[count + 1] - length;
|
|
|
|
}
|
|
|
|
|
|
|
|
numlines--;
|
|
|
|
#ifdef DEBUG
|
|
|
|
ConOutPrintf (_T("Reduced size: %ld lines\n"), numlines);
|
|
|
|
|
|
|
|
for (count = 0; count < numlines; count++)
|
|
|
|
{
|
|
|
|
ConOutPrintf (_T("%d: %s\n"), count, lines[count]);
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
}
|
|
|
|
|
|
|
|
/*copy entry in the history bufer*/
|
|
|
|
_tcscpy (lines[numlines], commandline);
|
|
|
|
numlines++;
|
|
|
|
|
|
|
|
/*set last lines[numlines] pointer next the end of last, valid,
|
|
|
|
just setted entry (the two lines above)*/
|
|
|
|
lines[numlines] = lines[numlines - 1] + _tcslen (commandline) + 1;
|
|
|
|
maxpos += _tcslen (commandline) + 1;
|
|
|
|
/* last line, empty */
|
|
|
|
|
|
|
|
curline = numlines;
|
|
|
|
}
|
|
|
|
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
2002-07-15 22:29:32 +00:00
|
|
|
#endif //#if 0
|