fixed warnings when compiled with -Wwrite-strings

svn path=/trunk/; revision=19131
This commit is contained in:
Thomas Bluemel 2005-11-11 16:11:13 +00:00
parent cda9f22a27
commit bda881de13
17 changed files with 165 additions and 152 deletions

View file

@ -50,7 +50,7 @@ static char sccsid[] = "@(#)getopt.c 4.13 (Berkeley) 2/23/91";
int opterr = 1, /* if error message should be printed */
optind = 1, /* index into parent argv vector */
optopt; /* character checked for validity */
char *optarg; /* argument associated with option */
const char *optarg; /* argument associated with option */
#define BADCH (int)'?'
#define EMSG ""
@ -58,7 +58,7 @@ char *optarg; /* argument associated with option */
int
getopt(int nargc, char * const *nargv, const char *ostr)
{
static char *place = EMSG; /* option letter processing */
static const char *place = EMSG; /* option letter processing */
register char *oli; /* option letter list index */
char *p;

View file

@ -1,6 +1,6 @@
/* getopt.h */
extern char *optarg;
extern const char *optarg;
extern int optind;
int

View file

@ -53,9 +53,9 @@ extern int allbinary;
extern off_t restart_point;
extern char reply_string[];
char *mname;
const char *mname;
jmp_buf jabort;
char *dotrans(), *domap();
const char *dotrans(), *domap();
extern short portnum;
extern char *hostname;
@ -64,7 +64,7 @@ extern int autologin;
* Connect to peer server and
* auto-login, if possible.
*/
void setpeer(int argc, char *argv[])
void setpeer(int argc, const char *argv[])
{
char *host;
@ -154,8 +154,8 @@ void setpeer(int argc, char *argv[])
}
struct types {
char *t_name;
char *t_mode;
const char *t_name;
const char *t_mode;
int t_type;
char *t_arg;
} types[] = {
@ -171,13 +171,13 @@ struct types {
* Set transfer type.
*/
void settype(argc, argv)
char *argv[];
const char *argv[];
{
register struct types *p;
int comret;
if (argc > 2) {
char *sep;
const char *sep;
printf("usage: %s [", argv[0]);
sep = " ";
@ -216,7 +216,7 @@ void settype(argc, argv)
}
}
char *stype[] = {
const char *stype[] = {
"type",
"",
0
@ -308,11 +308,11 @@ void setstruct(argc, argv)
*/
void put(argc, argv)
int argc;
char *argv[];
const char *argv[];
{
char *cmd;
const char *cmd;
int loc = 0;
char *oldargv1, *oldargv2;
const char *oldargv1, *oldargv2;
if (argc == 2) {
argc++;
@ -374,12 +374,12 @@ usage:
* Send multiple files.
*/
void mput(argc, argv)
char *argv[];
const char *argv[];
{
register int i;
int ointer;
extern jmp_buf jabort;
char *tp;
const char *tp;
if (argc < 2) {
(void) strcat(line, " ");
@ -505,13 +505,13 @@ void mput(argc, argv)
}
void reget(argc, argv)
char *argv[];
const char *argv[];
{
(void) getit(argc, argv, 1, "r+w");
}
void get(argc, argv)
char *argv[];
const char *argv[];
{
(void) getit(argc, argv, 0, restart_point ? "r+w" : "w" );
}
@ -520,11 +520,11 @@ void get(argc, argv)
* Receive one file.
*/
int getit(argc, argv, restartit, mode)
char *argv[];
char *mode;
const char *argv[];
const char *mode;
{
int loc = 0;
char *oldargv1, *oldargv2;
const char *oldargv1, *oldargv2;
if (argc == 2) {
argc++;
@ -565,7 +565,8 @@ usage:
return (0);
}
if (loc && mcase) {
char *tp = argv[1], *tp2, tmpbuf[MAXPATHLEN];
const char *tp = argv[1];
char *tp2, tmpbuf[MAXPATHLEN];
while (*tp && !islower(*tp)) {
tp++;
@ -675,9 +676,10 @@ mabort()
* Get multiple files.
*/
void mget(argc, argv)
char *argv[];
const char *argv[];
{
char *cp, *tp, *tp2, tmpbuf[MAXPATHLEN];
const char *cp, *tp;
char *tp2, tmpbuf[MAXPATHLEN];
int ointer;
extern jmp_buf jabort;
@ -756,7 +758,8 @@ remglob(argv,doswitch)
static FILE *ftemp = NULL;
static char **args;
int oldverbose, oldhash;
char *cp, *mode;
char *cp;
const char *mode;
if (!mflag) {
if (!doglob) {
@ -808,7 +811,7 @@ remglob(argv,doswitch)
return (buf);
}
static char *
static const char *
onoff(bool)
int bool;
{
@ -1002,7 +1005,7 @@ void setdebug(argc, argv)
* on remote machine.
*/
void cd(argc, argv)
char *argv[];
const char *argv[];
{
if (argc < 2) {
@ -1034,7 +1037,7 @@ void cd(argc, argv)
* on local machine.
*/
void lcd(argc, argv)
char *argv[];
const char *argv[];
{
char buf[MAXPATHLEN];
@ -1064,7 +1067,7 @@ void lcd(argc, argv)
* Delete a single file.
*/
void delete(argc, argv)
char *argv[];
const char *argv[];
{
if (argc < 2) {
@ -1089,7 +1092,7 @@ void delete(argc, argv)
* Delete multiple files.
*/
void mdelete(argc, argv)
char *argv[];
const char *argv[];
{
char *cp;
int ointer;
@ -1139,7 +1142,7 @@ void mdelete(argc, argv)
* Rename a remote file.
*/
void renamefile(argc, argv)
char *argv[];
const char *argv[];
{
if (argc < 2) {
@ -1178,9 +1181,9 @@ usage:
* of remote files.
*/
void ls(argc, argv)
char *argv[];
const char *argv[];
{
char *cmd;
const char *cmd;
if (argc < 2)
argc++, argv[1] = NULL;
@ -1211,9 +1214,10 @@ void ls(argc, argv)
* of multiple remote files.
*/
void mls(argc, argv)
char *argv[];
const char *argv[];
{
char *cmd, mode[1], *dest;
const char *cmd, *dest;
char mode[1];
int ointer, i;
extern jmp_buf jabort;
@ -1395,7 +1399,7 @@ void shell(argc, argv)
*/
void user(argc, argv)
int argc;
char **argv;
const char **argv;
{
char acct[80], *getpass();
int n, aflag = 0;
@ -1466,7 +1470,7 @@ void pwd()
* Make a directory.
*/
void makedir(argc, argv)
char *argv[];
const char *argv[];
{
if (argc < 2) {
@ -1497,7 +1501,7 @@ void makedir(argc, argv)
* Remove a directory.
*/
void removedir(argc, argv)
char *argv[];
const char *argv[];
{
if (argc < 2) {
@ -1528,7 +1532,7 @@ void removedir(argc, argv)
* Send a line, verbatim, to the remote machine.
*/
void quote(argc, argv)
char *argv[];
const char *argv[];
{
int i;
char buf[BUFSIZ];
@ -1565,7 +1569,7 @@ void quote(argc, argv)
*/
void site(argc, argv)
char *argv[];
const char *argv[];
{
int i;
char buf[BUFSIZ];
@ -1597,7 +1601,7 @@ void site(argc, argv)
}
void do_chmod(argc, argv)
char *argv[];
const char *argv[];
{
if (argc == 2) {
printf("usage: %s mode file-name\n", argv[0]);
@ -1692,7 +1696,7 @@ void disconnect()
}
int confirm(cmd, file)
char *cmd, *file;
const char *cmd, *file;
{
char line[BUFSIZ];
@ -1721,7 +1725,7 @@ static void fatal(msg)
* from the expression, we return only the first.
*/
int globulize(cpp)
char **cpp;
const char **cpp;
{
char **globbed;
@ -1796,7 +1800,7 @@ proxabort()
void doproxy(argc,argv)
int argc;
char *argv[];
const char *argv[];
{
register struct cmd *c;
struct cmd *getcmd();
@ -1901,12 +1905,13 @@ void setntrans(argc,argv)
ntout[16] = '\0';
}
char *
const char *
dotrans(name)
char *name;
const char *name;
{
static char new[MAXPATHLEN];
char *cp1, *cp2 = new;
const char *cp1;
char *cp2 = new;
register int i, ostop, found;
for (ostop = 0; *(ntout + ostop) && ostop < 16; ostop++);
@ -1943,7 +1948,7 @@ setpassive(argc, argv)
void setnmap(argc, argv)
int argc;
char *argv[];
const char *argv[];
{
char *cp;
@ -1983,13 +1988,14 @@ void setnmap(argc, argv)
(void) strncpy(mapout, cp, MAXPATHLEN - 1);
}
char *
const char *
domap(name)
char *name;
const char *name;
{
static char new[MAXPATHLEN];
register char *cp1 = name, *cp2 = mapin;
char *tp[9], *te[9];
const char *cp1 = name;
char *cpn, *cp2 = mapin;
const char *tp[9], *te[9];
int i, toks[9], toknum = 0, match = 1;
for (i=0; i < 9; ++i) {
@ -2032,33 +2038,34 @@ domap(name)
{
toks[toknum] = 0;
}
cp1 = new;
*cp1 = '\0';
cpn = new;
*cpn = '\0';
cp2 = mapout;
while (*cp2) {
match = 0;
switch (*cp2) {
case '\\':
if (*(cp2 + 1)) {
*cp1++ = *++cp2;
*cpn++ = *++cp2;
}
break;
case '[':
LOOP:
if (*++cp2 == '$' && isdigit(*(cp2+1))) {
if (*++cp2 == '0') {
char *cp3 = name;
const char *cp3 = name;
while (*cp3) {
*cp1++ = *cp3++;
*cpn++ = *cp3++;
}
match = 1;
}
else if (toks[toknum = *cp2 - '1']) {
char *cp3 = tp[toknum];
const char *cp3 = tp[toknum];
while (cp3 != te[toknum]) {
*cp1++ = *cp3++;
*cpn++ = *cp3++;
}
match = 1;
}
@ -2072,24 +2079,24 @@ LOOP:
else if (*cp2 == '$' &&
isdigit(*(cp2+1))) {
if (*++cp2 == '0') {
char *cp3 = name;
const char *cp3 = name;
while (*cp3) {
*cp1++ = *cp3++;
*cpn++ = *cp3++;
}
}
else if (toks[toknum =
*cp2 - '1']) {
char *cp3=tp[toknum];
const char *cp3=tp[toknum];
while (cp3 !=
te[toknum]) {
*cp1++ = *cp3++;
*cpn++ = *cp3++;
}
}
}
else if (*cp2) {
*cp1++ = *cp2++;
*cpn++ = *cp2++;
}
}
if (!*cp2) {
@ -2126,29 +2133,29 @@ LOOP:
case '$':
if (isdigit(*(cp2 + 1))) {
if (*++cp2 == '0') {
char *cp3 = name;
const char *cp3 = name;
while (*cp3) {
*cp1++ = *cp3++;
*cpn++ = *cp3++;
}
}
else if (toks[toknum = *cp2 - '1']) {
char *cp3 = tp[toknum];
const char *cp3 = tp[toknum];
while (cp3 != te[toknum]) {
*cp1++ = *cp3++;
*cpn++ = *cp3++;
}
}
break;
}
/* intentional drop through */
default:
*cp1++ = *cp2;
*cpn++ = *cp2;
break;
}
cp2++;
}
*cp1 = '\0';
*cpn = '\0';
if (!*new) {
return(name);
}
@ -2207,7 +2214,7 @@ void syst()
void macdef(argc, argv)
int argc;
char *argv[];
const char *argv[];
{
char *tmp;
int c;
@ -2283,7 +2290,7 @@ void macdef(argc, argv)
* get size of file on remote machine
*/
void sizecmd(argc, argv)
char *argv[];
const char *argv[];
{
if (argc < 2) {
@ -2308,7 +2315,7 @@ void sizecmd(argc, argv)
* get last modification time of file on remote machine
*/
void modtime(argc, argv)
char *argv[];
const char *argv[];
{
int overbose;
@ -2347,7 +2354,7 @@ void modtime(argc, argv)
* show status on reomte machine
*/
void rmtstatus(argc, argv)
char *argv[];
const char *argv[];
{
(void) command(argc > 1 ? "STAT %s" : "STAT" , argv[1]);
}
@ -2356,7 +2363,7 @@ void rmtstatus(argc, argv)
* get file if modtime is more recent than current file
*/
void newer(argc, argv)
char *argv[];
const char *argv[];
{
if (getit(argc, argv, -1, "w")) {
printf("Local file \"%s\" is newer than remote file \"%s\"\n",

View file

@ -30,10 +30,11 @@ static char sccsid[] = "@(#)domacro.c 1.6 (Berkeley) 2/28/89";
void domacro(argc, argv)
int argc;
char *argv[];
const char *argv[];
{
register int i, j;
register char *cp1, *cp2;
int i, j;
const char *cp1;
char *cp2;
int count = 2, loopflg = 0;
char line2[200];
struct cmd *getcmd(), *c;

View file

@ -113,7 +113,7 @@ int fgetcSocket(int s)
#endif
char *fprintfSocket(int s, char *format, ...)
const char *fprintfSocket(int s, const char *format, ...)
{
va_list argptr;
char buffer[10009];
@ -127,7 +127,7 @@ char *fprintfSocket(int s, char *format, ...)
return NULL;
}
char *fputsSocket(char *format, int s)
const char *fputsSocket(const char *format, int s)
{
send(s, format, strlen(format), 0);

View file

@ -98,9 +98,9 @@ sig_t lostpeer();
off_t restart_point = 0;
SOCKET cin, cout;
int dataconn(char *mode);
int dataconn(const char *mode);
int command(char *fmt, ...);
int command(const char *fmt, ...);
char *hostname;
@ -203,19 +203,23 @@ bad:
return ((char *)0);
}
int login(char *host)
int login(const char *host)
{
char tmp[80];
char *user, *pass, *acct;
char *puser, *ppass, *pacct;
const char *user, *pass, *acct;
int n, aflag = 0;
user = pass = acct = 0;
if (ruserpass(host, &user, &pass, &acct) < 0) {
if (ruserpass(host, &puser, &ppass, &pacct) < 0) {
code = -1;
return(0);
}
user = puser;
pass = ppass;
acct = pacct;
while (user == NULL) {
char *myname = "none"; // This needs to become the usename env
const char *myname = "none"; // This needs to become the usename env
if (myname)
printf("Name (%s:%s): ", host, myname);
@ -273,7 +277,7 @@ cmdabort(int sig)
}
/*VARARGS1*/
int command(char *fmt, ...)
int command(const char *fmt, ...)
{
va_list ap;
int r;
@ -450,7 +454,7 @@ void abortsend()
#define HASHBYTES 1024
void sendrequest(char *cmd, char *local, char *remote, int printnames)
void sendrequest(const char *cmd, const char *local, const char *remote, int printnames)
{
FILE *fin;
int dout = 0;
@ -461,7 +465,7 @@ void sendrequest(char *cmd, char *local, char *remote, int printnames)
register int c, d;
struct stat st;
struct timeval start, stop;
char *mode;
const char *mode;
if (verbose && printnames) {
if (local && *local != '-')
@ -723,7 +727,7 @@ void abortrecv()
}
#endif
void recvrequest(char *cmd, char *local, char *remote, char *mode,
void recvrequest(const char *cmd, const char *local, const char *remote, const char *mode,
int printnames)
{
FILE *fout = stdout;
@ -1253,7 +1257,7 @@ bad:
return (1);
}
int dataconn(char *mode)
int dataconn(const char *mode)
{
struct sockaddr_in from;
int s, fromlen = sizeof (from);
@ -1278,7 +1282,7 @@ int dataconn(char *mode)
}
void ptransfer(direction, bytes, t0, t1)
char *direction;
const char *direction;
long bytes;
struct timeval *t0, *t1;
{
@ -1432,12 +1436,12 @@ abortpt()
#endif
void proxtrans(cmd, local, remote)
char *cmd, *local, *remote;
const char *cmd, *local, *remote;
{
// void (*oldintr)(int);
int tmptype, oldtype = 0, secndflag = 0, nfnd;
extern jmp_buf ptabort;
char *cmd2;
const char *cmd2;
// struct
fd_set mask;

View file

@ -130,7 +130,7 @@ extern char *stringbase; /* current scan point in line buffer */
extern char argbuf[200]; /* argument storage buffer */
extern char *argbase; /* current storage point in arg buffer */
extern int margc; /* count of arguments on input line */
extern char *margv[20]; /* args parsed from input line */
extern const char *margv[20]; /* args parsed from input line */
extern int cpend; /* flag: if != 0, then pending server reply */
extern int mflag; /* flag: if != 0, then active multi command */
@ -140,8 +140,8 @@ extern int options; /* used during socket creation */
* Format of command table.
*/
struct cmd {
char *c_name; /* name of command */
char *c_help; /* help string */
const char *c_name; /* name of command */
const char *c_help; /* help string */
char c_bell; /* give bell when command completes */
char c_conn; /* must be connected to use command */
char c_proxy; /* proxy server may execute */

View file

@ -115,18 +115,18 @@ char *stringbase; /* current scan point in line buffer */
char argbuf[200]; /* argument storage buffer */
char *argbase; /* current storage point in arg buffer */
int margc; /* count of arguments on input line */
char *margv[20]; /* args parsed from input line */
const char *margv[20]; /* args parsed from input line */
int cpend; /* flag: if != 0, then pending server reply */
int mflag; /* flag: if != 0, then active multi command */
int options; /* used during socket creation */
static char *slurpstring();
static const char *slurpstring();
int main(int argc, char *argv[])
int main(int argc, const char *argv[])
{
register char *cp;
const char *cp;
int top;
#if 0
char homedir[MAXPATHLEN];
@ -357,12 +357,12 @@ void cmdscanner(top)
struct cmd *
getcmd(name)
register char *name;
const char *name;
{
extern struct cmd cmdtab[];
register char *p, *q;
register struct cmd *c, *found;
register int nmatches, longest;
const char *p, *q;
struct cmd *c, *found;
int nmatches, longest;
longest = 0;
nmatches = 0;
@ -393,7 +393,7 @@ int slrflag;
void makeargv()
{
char **argp;
const char **argp;
margc = 0;
argp = margv;
@ -409,7 +409,7 @@ void makeargv()
* implemented with FSM to
* handle quoting and strings
*/
static char *
static const char *
slurpstring()
{
int got_one = 0;

View file

@ -1,8 +1,8 @@
int fgetcSocket(int s);
char *fputsSocket(char *format, int s);
const char *fputsSocket(const char *format, int s);
char *fprintfSocket(int s, char *format, ...);
const char *fprintfSocket(int s, const char *format, ...);
int fputcSocket(int s, char putChar);
int fputSocket(int s, char *putChar, int len);
@ -13,34 +13,34 @@ char **glob();
int herror(char *s);
int getreply(int expecteof);
int ruserpass(char *host, char **aname, char **apass, char **aacct);
int ruserpass(const char *host, char **aname, char **apass, char **aacct);
char *getpass(const char *prompt);
void makeargv(void);
void domacro(int argc, char *argv[]);
void proxtrans(char *cmd, char *local, char *remote);
void domacro(int argc, const char *argv[]);
void proxtrans(const char *cmd, const char *local, const char *remote);
int null(void);
int initconn(void);
void disconnect(void);
void ptransfer(char *direction, long bytes, struct timeval *t0, struct timeval *t1);
void ptransfer(const char *direction, long bytes, struct timeval *t0, struct timeval *t1);
void setascii(void);
void setbinary(void);
void setebcdic(void);
void settenex(void);
void tvsub(struct timeval *tdiff, struct timeval *t1, struct timeval *t0);
void setpassive(int argc, char *argv[]);
void setpeer(int argc, char *argv[]);
void setpeer(int argc, const char *argv[]);
void cmdscanner(int top);
void pswitch(int flag);
void quit(void);
int login(char *host);
int command(char *fmt, ...);
int globulize(char **cpp);
void sendrequest(char *cmd, char *local, char *remote, int printnames);
void recvrequest(char *cmd, char *local, char *remote, char *mode,
int login(const char *host);
int command(const char *fmt, ...);
int globulize(const char **cpp);
void sendrequest(const char *cmd, const char *local, const char *remote, int printnames);
void recvrequest(const char *cmd, const char *local, const char *remote, const char *mode,
int printnames);
int confirm(char *cmd, char *file);
int confirm(const char *cmd, const char *file);
void blkfree(char **av0);
int getit(int argc, char *argv[], int restartit, char *mode);
int getit(int argc, const char *argv[], int restartit, const char *mode);
int sleep(int time);
char *tail();

View file

@ -50,7 +50,7 @@ static FILE *cfile;
static char tokval[100];
static struct toktab {
char *tokstr;
const char *tokstr;
int tval;
} toktab[]= {
{"default", DEFAULT},
@ -66,10 +66,11 @@ static struct toktab {
extern char *hostname;
static int token(void);
int ruserpass(char *host, char **aname, char **apass, char **aacct)
int ruserpass(const char *host, char **aname, char **apass, char **aacct)
{
char *hdir, buf[BUFSIZ], *tmp;
char myname[MAXHOSTNAMELEN], *mydomain;
const char *hdir, *mydomain;
char buf[BUFSIZ], *tmp;
char myname[MAXHOSTNAMELEN];
int t, i, c, usedefault = 0;
struct stat stb;
extern int errno;

View file

@ -219,7 +219,7 @@ void TANSIParser::ConSetCursorPos(int x, int y) {
Console.SetCursorPosition(x, y);
}
char* TANSIParser::GetTerminalID()
const char* TANSIParser::GetTerminalID()
{
return "\033[?1;2c";
}
@ -479,7 +479,7 @@ char* TANSIParser::ParseEscapeANSI(char* pszBuffer, char* pszBufferEnd)
// Get Terminal ID
case 'c':
{
char* szTerminalId = GetTerminalID();
const char* szTerminalId = GetTerminalID();
Network.WriteString(szTerminalId, strlen(szTerminalId));
break;
}
@ -1005,7 +1005,7 @@ char* TANSIParser::ParseEscape(char* pszBuffer, char* pszBufferEnd) {
// Terminal ID Request
case 'Z':
{
char* szTerminalId = GetTerminalID();
const char* szTerminalId = GetTerminalID();
Network.WriteString(szTerminalId, strlen(szTerminalId));
break;
}

View file

@ -40,7 +40,7 @@ private:
#endif
void ConSetAttribute(unsigned char wAttr);
char *GetTerminalID();
const char *GetTerminalID();
void ConSetCursorPos(int x, int y);
void ResetTerminal();
void Init();

View file

@ -60,17 +60,17 @@ TConsole::TConsole(HANDLE h) {
GetConsoleScreenBufferInfo(hConsole, &ConsoleInfo);
// Start with correct colors
int fg = ini.get_normal_fg();
int bg = ini.get_normal_bg();
if(fg == -1)
fg = defaultfg = origfg = ConsoleInfo.wAttributes & 0xF;
int color_fg = ini.get_normal_fg();
int color_bg = ini.get_normal_bg();
if(color_fg == -1)
color_fg = defaultfg = origfg = ConsoleInfo.wAttributes & 0xF;
else
defaultfg = origfg = fg;
if(bg == -1)
bg = defaultbg = origbg = (ConsoleInfo.wAttributes >> 4) & 0xF;
defaultfg = origfg = color_fg;
if(color_bg == -1)
color_bg = defaultbg = origbg = (ConsoleInfo.wAttributes >> 4) & 0xF;
else
defaultbg = origbg = bg;
wAttributes = fg | (bg << 4);
defaultbg = origbg = color_bg;
wAttributes = color_fg | (color_bg << 4);
reverse = blink = underline = false;
SetConsoleTextAttribute(hConsole, wAttributes);

View file

@ -186,8 +186,8 @@ enum {
};
struct ini_variable {
char *name; // variable name
char *section; // name of ini file section the variable is in
const char *name; // variable name
const char *section; // name of ini file section the variable is in
enum ini_data_type data_type; // type of data
void *ini_data; // pointer to data
int max_size; // max size if string

View file

@ -198,7 +198,7 @@ private:
// Host configration
char host[128];
char *port;
const char *port;
// Aliases
char **aliases;

View file

@ -146,13 +146,13 @@ struct cmdHistory * cfgets (char *buf, unsigned int length, struct cmdHistory *c
if (cursor < current)
if (InputRecord.Event.KeyEvent.dwControlKeyState &
(LEFT_CTRL_PRESSED | RIGHT_CTRL_PRESSED)) {
unsigned int i,j;
unsigned int j, k;
for (j = cursor; j <= current; j++)
if (buf[j+1] == ' ' || (j+1)==current)
break;
for (i = ++j; i <= current; i++)
if (buf[i] != ' ' || i == current) {
cursor = i == current ? --i : i;
for (k = ++j; k <= current; k++)
if (buf[k] != ' ' || k == current) {
cursor = k == current ? --k : k;
break;
}
} else
@ -163,13 +163,13 @@ struct cmdHistory * cfgets (char *buf, unsigned int length, struct cmdHistory *c
if (cursor > 0)
if(InputRecord.Event.KeyEvent.dwControlKeyState &
(LEFT_CTRL_PRESSED | RIGHT_CTRL_PRESSED)) {
int i,j;
int j, k;
for (j = cursor; j >= 0; j--)
if (buf[j-1] != ' ')
break;
for (i = --j; i >= 0; i--)
if (buf[i] == ' ' || i == 0) {
cursor = !i ? i : ++i;
for (k = --j; k >= 0; k--)
if (buf[k] == ' ' || k == 0) {
cursor = !k ? k : ++k;
break;
}
} else
@ -414,13 +414,13 @@ enum {
struct command {
char* cmd; // command
const char* cmd; // command
int minLen, // minimal length for match
minParms, // minimal count of parms
maxParms; // maximal -/- (negative disables)
int isSubCmd, // is a subcommand - number of wich command
haveSubCmd; // have subcommands? 0 or 1
char* usage; // text of usage
const char* usage; // text of usage
};
command cmdList[__COMMAND_LIST_SIZE] = {

View file

@ -294,7 +294,7 @@ void TScroller::ScrollBack(){
for (r = 0; r < CON_HEIGHT; r++) {
memset(szStatusLine, ' ', CON_COLS);
for(c = 0; c <= CON_WIDTH; c++) {
int done = FALSE;
done = FALSE;
if (ch >= iScrollSize) p = ' ';
else p = stripped[ch];
switch(p) {