Fix output when client is built against termcap.
The pointer passed to tgetstr() must not be reset each time around the loop. Also some other minor cleanups in term_init(). git-svn-id: svn://svn.code.sf.net/p/bitchx/code/trunk@428 13b04d17-f746-0410-82c6-800466cd88b0
This commit is contained in:
@@ -1,5 +1,7 @@
|
|||||||
[Changes 1.2c01]
|
[Changes 1.2c01]
|
||||||
|
|
||||||
|
* Fix output when built against termcap. (caf)
|
||||||
|
|
||||||
* Fix STATUS_NOTIFY so that it appears in the right window. (caf)
|
* Fix STATUS_NOTIFY so that it appears in the right window. (caf)
|
||||||
|
|
||||||
* Improve robustness of status formats handling. (caf)
|
* Improve robustness of status formats handling. (caf)
|
||||||
|
|||||||
@@ -797,9 +797,6 @@ PROCESS_INFORMATION pi = { 0 };
|
|||||||
#endif /* STERM_C */
|
#endif /* STERM_C */
|
||||||
#endif /* NOT IN WTERM_C */
|
#endif /* NOT IN WTERM_C */
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* term_init: does all terminal initialization... reads termcap info, sets
|
* term_init: does all terminal initialization... reads termcap info, sets
|
||||||
* the terminal to CBREAK, no ECHO mode. Chooses the best of the terminal
|
* the terminal to CBREAK, no ECHO mode. Chooses the best of the terminal
|
||||||
@@ -812,9 +809,9 @@ int termfeatures = 0;
|
|||||||
int term_init (char *term)
|
int term_init (char *term)
|
||||||
{
|
{
|
||||||
#ifndef WTERM_C
|
#ifndef WTERM_C
|
||||||
int i;
|
int i;
|
||||||
int desired;
|
int desired;
|
||||||
|
char *termcap2_ptr = termcap2;
|
||||||
|
|
||||||
#if !defined(__EMX__) && !defined(WINNT) && !defined(GUI)
|
#if !defined(__EMX__) && !defined(WINNT) && !defined(GUI)
|
||||||
memset(current_term, 0, sizeof(struct term_struct));
|
memset(current_term, 0, sizeof(struct term_struct));
|
||||||
@@ -852,28 +849,20 @@ int term_init (char *term)
|
|||||||
|
|
||||||
for (i = 0; i < numcaps; i++)
|
for (i = 0; i < numcaps; i++)
|
||||||
{
|
{
|
||||||
int ival;
|
|
||||||
char *cval;
|
|
||||||
|
|
||||||
if (tcaps[i].type == CAP_TYPE_INT)
|
if (tcaps[i].type == CAP_TYPE_INT)
|
||||||
{
|
{
|
||||||
ival = Tgetnum(tcaps[i]);
|
*(int *)tcaps[i].ptr = Tgetnum(tcaps[i]);
|
||||||
*(int *)tcaps[i].ptr = ival;
|
|
||||||
}
|
}
|
||||||
else if (tcaps[i].type == CAP_TYPE_BOOL)
|
else if (tcaps[i].type == CAP_TYPE_BOOL)
|
||||||
{
|
{
|
||||||
ival = Tgetflag(tcaps[i]);
|
*(int *)tcaps[i].ptr = Tgetflag(tcaps[i]);
|
||||||
*(int *)tcaps[i].ptr = ival;
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
char *tmp = termcap2;
|
char *cval = Tgetstr(tcaps[i], termcap2_ptr);
|
||||||
|
|
||||||
cval = Tgetstr(tcaps[i], tmp);
|
|
||||||
if (cval == (char *) -1)
|
if (cval == (char *) -1)
|
||||||
*(char **)tcaps[i].ptr = NULL;
|
cval = NULL;
|
||||||
else
|
*(char **)tcaps[i].ptr = cval;
|
||||||
*(char **)tcaps[i].ptr = cval;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user