terminfo: chop off $<N> syntax #769

This commit is contained in:
nick black 2020-07-13 05:54:59 -04:00
parent 1c95241948
commit ff569d7114
No known key found for this signature in database
GPG Key ID: 5F43400C21CBFACC

View File

@ -32,6 +32,14 @@ int terminfostr(char** gseq, const char* name){
*gseq = NULL; *gseq = NULL;
return -1; return -1;
} }
// terminfo syntax allows a number N of milliseconds worth of pause to be
// specified using $<N> syntax. this is then honored by tputs(). but we don't
// use tputs(), instead preferring the much faster stdio+tiparm(). to avoid
// dumping "$<N>" sequences all over stdio, we chop them out.
char* pause;
if( (pause = strchr(*gseq, '$')) ){
*pause = '\0';
}
return 0; return 0;
} }