Synchronet now requires the libarchive development package (e.g. libarchive-dev on Debian-based Linux distros, libarchive.org for more info) to build successfully.

Commit af46ca3f authored by deuce's avatar deuce

Properly detect nF sequence types from ECMA 35.

Allow setting a '0' for left/right margins to leave them unchanged.
parent d7417b36
......@@ -646,7 +646,10 @@ CIOLIBEXPORT int CIOLIBCALL ciomouse_delevent(int event);
#define CIO_KEY_RIGHT (0x4d << 8)
#define CIO_KEY_PPAGE (0x49 << 8)
#define CIO_KEY_NPAGE (0x51 << 8)
#define CIO_KEY_SHIFT_F(x)((x<11)?((0x53+x) << 8):((0x7c+x) << 8))
#define CIO_KEY_CTRL_F(x) ((x<11)?((0x67+x) << 8):((0x7e+x) << 8))
#define CIO_KEY_ALT_F(x) ((x<11)?((0x67+x) << 8):((0x80+x) << 8))
#define CIO_KEY_BACKTAB (0x0f << 8)
#define CIO_KEY_MOUSE 0x7d00 // This is the right mouse on Schneider/Amstrad PC1512 PC keyboards "F-14"
#define CIO_KEY_QUIT 0x7e00 // "F-15"
......
......@@ -1405,20 +1405,27 @@ static enum {
SEQ_COMPLETE
} legal_sequence(const char *seq, size_t max_len)
{
size_t intermediate_len;
if (seq == NULL)
return SEQ_BROKEN;
if (seq[0] == 0)
goto incomplete;
/* Check that it's part of C1 set or part of the Independent control functions */
/* Check that it's part of C1 set, part of the Independent control functions, or an nF sequence type (ECMA 35)*/
if (seq[0] < 0x40 || seq[0] > 0x7e)
return SEQ_BROKEN;
intermediate_len = strspn(&seq[1+parameter_len], " !\"#$%&'()*+,-./");
if (seq[1+intermediate_len] == 0)
goto incomplete;
if (seq[1+intermediate_len] < 0x30 || seq[1+intermediate_len] > 0x7e)
return SEQ_BROKEN;
/* Check if it's CSI */
if (seq[0] == '[') {
size_t parameter_len;
size_t intermediate_len;
if (seq[1] >= '<' && seq[1] <= '?')
parameter_len = strspn(&seq[1], "0123456789:;<=>?");
......@@ -3324,7 +3331,11 @@ static void do_ansi(struct cterminal *cterm, char *retbuf, size_t retsize, int *
seq_default(seq, 0, ABS_MINX);
seq_default(seq, 1, ABS_MAXX);
col = seq->param_int[0];
if (col == 0)
col = cterm->left_margin;
max_col = seq->param_int[1];
if (max_col == 0)
max_col = cterm->right_margin;
if(col >= ABS_MINX && max_col > col && max_col <= ABS_MAXX) {
cterm->left_margin = col;
cterm->right_margin = max_col;
......
......@@ -1021,6 +1021,7 @@ CSI Pn1 ; Pn2 s
Set Left and Right Margins
Defaults: Pn1 = 1
Pn2 = last column on screen
If either Pn1 or Pn2 is zero, the current setting is retained.
Selects left and right margins, defining the scrolling region. Pn1 is
the column number of the first column in the scrolling region. Pn2 is
the column number of the right column.
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment