1
0
mirror of https://git.tartarus.org/simon/putty.git synced 2025-07-02 03:52:49 -05:00

Default handling of VT100 line drawing characters in cut and paste is

now to translate them into poor man's characters (+--+ and |). We also
have an option to disable this (and map line drawing characters to the
corresponding ASCII code as before). Thanks to Robert de Bath.

[originally from svn r1029]
This commit is contained in:
Simon Tatham
2001-04-09 11:59:35 +00:00
parent ab3443b9e6
commit 2c39b69a52
4 changed files with 42 additions and 28 deletions

View File

@ -1948,34 +1948,34 @@ static void clipme(unsigned long *top, unsigned long *bottom, char *workbuf) {
}
while (top < nlpos && top < bottom)
{
#if 0
/* VT Specials -> ISO8859-1 */
static const char poorman2[] =
"* # HTFFCRLF\xB0 \xB1 NLVT+ + + + + - - - - - + + + + | <=>=PI!=\xA3 \xB7 ";
#endif
int ch = (*top & CHAR_MASK);
int set = (*top & CSET_MASK);
#if 0
if ((*top & ATTR_LINEDRW) && ch >= 0x60 && ch < 0x7F) {
int x;
*wbptr++ = poorman2[2*(ch-0x60)];
if ( (x = poorman2[2*(ch-0x60)+1]) != ' ')
*wbptr++ = x;
} else
#endif
#if 0
if ((*top & ATTR_GBCHR) && ch == '#')
*wbptr++ = (unsigned char) 0xA3;
else
#endif
if ( wblen == buflen )
{
workbuf = srealloc(workbuf, buflen += 100);
wbptr = workbuf + wblen;
/* VT Specials -> ISO8859-1 for Cut&Paste */
static const unsigned char poorman2[] =
"* # HTFFCRLF\xB0 \xB1 NLVT+ + + + + - - - - - + + + + | <=>=PI!=\xA3 \xB7 ";
if (set && !cfg.rawcnp) {
if (set == ATTR_LINEDRW && ch >= 0x60 && ch < 0x7F) {
int x;
if ((x = poorman2[2*(ch-0x60)+1]) == ' ')
x = 0;
ch = (x<<8) + poorman2[2*(ch-0x60)];
}
}
while(ch != 0) {
if (cfg.rawcnp || !!(ch&0xE0)) {
if ( wblen == buflen )
{
workbuf = srealloc(workbuf, buflen += 100);
wbptr = workbuf + wblen;
}
wblen++;
*wbptr++ = (unsigned char) ch;
}
ch>>=8;
}
wblen++;
*wbptr++ = (unsigned char) ch;
top++;
}
if (nl) {