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]
|
||||
|
||||
* Fix output when built against termcap. (caf)
|
||||
|
||||
* Fix STATUS_NOTIFY so that it appears in the right window. (caf)
|
||||
|
||||
* Improve robustness of status formats handling. (caf)
|
||||
|
||||
@@ -797,9 +797,6 @@ PROCESS_INFORMATION pi = { 0 };
|
||||
#endif /* STERM_C */
|
||||
#endif /* NOT IN WTERM_C */
|
||||
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* term_init: does all terminal initialization... reads termcap info, sets
|
||||
* the terminal to CBREAK, no ECHO mode. Chooses the best of the terminal
|
||||
@@ -814,7 +811,7 @@ int term_init (char *term)
|
||||
#ifndef WTERM_C
|
||||
int i;
|
||||
int desired;
|
||||
|
||||
char *termcap2_ptr = termcap2;
|
||||
|
||||
#if !defined(__EMX__) && !defined(WINNT) && !defined(GUI)
|
||||
memset(current_term, 0, sizeof(struct term_struct));
|
||||
@@ -852,27 +849,19 @@ int term_init (char *term)
|
||||
|
||||
for (i = 0; i < numcaps; i++)
|
||||
{
|
||||
int ival;
|
||||
char *cval;
|
||||
|
||||
if (tcaps[i].type == CAP_TYPE_INT)
|
||||
{
|
||||
ival = Tgetnum(tcaps[i]);
|
||||
*(int *)tcaps[i].ptr = ival;
|
||||
*(int *)tcaps[i].ptr = Tgetnum(tcaps[i]);
|
||||
}
|
||||
else if (tcaps[i].type == CAP_TYPE_BOOL)
|
||||
{
|
||||
ival = Tgetflag(tcaps[i]);
|
||||
*(int *)tcaps[i].ptr = ival;
|
||||
*(int *)tcaps[i].ptr = Tgetflag(tcaps[i]);
|
||||
}
|
||||
else
|
||||
{
|
||||
char *tmp = termcap2;
|
||||
|
||||
cval = Tgetstr(tcaps[i], tmp);
|
||||
char *cval = Tgetstr(tcaps[i], termcap2_ptr);
|
||||
if (cval == (char *) -1)
|
||||
*(char **)tcaps[i].ptr = NULL;
|
||||
else
|
||||
cval = NULL;
|
||||
*(char **)tcaps[i].ptr = cval;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user