]> Sergey Matveev's repositories - st.git/blobdiff - st.c
Optimisations
[st.git] / st.c
diff --git a/st.c b/st.c
index 034954d0aa83de340560498116a75930bc1b3db9..57c6e962ac778da43795ed855035b4554ebd02cf 100644 (file)
--- a/st.c
+++ b/st.c
@@ -1132,6 +1132,7 @@ csiparse(void)
 {
        char *p = csiescseq.buf, *np;
        long int v;
+       int sep = ';'; /* colon or semi-colon, but not both */
 
        csiescseq.narg = 0;
        if (*p == '?') {
@@ -1149,7 +1150,9 @@ csiparse(void)
                        v = -1;
                csiescseq.arg[csiescseq.narg++] = v;
                p = np;
-               if (*p != ';' || csiescseq.narg == ESC_ARG_SIZ)
+               if (sep == ';' && *p == ':')
+                       sep = ':'; /* allow override to colon once */
+               if (*p != sep || csiescseq.narg == ESC_ARG_SIZ)
                        break;
                p++;
        }
@@ -1643,7 +1646,7 @@ csihandle(void)
                        ttywrite(vtiden, strlen(vtiden), 0);
                break;
        case 'b': /* REP -- if last char is printable print it <n> more times */
-               DEFAULT(csiescseq.arg[0], 1);
+               LIMIT(csiescseq.arg[0], 1, 65535);
                if (term.lastc)
                        while (csiescseq.arg[0]-- > 0)
                                tputc(term.lastc);