JasonWoof Got questions, comments, patches, etc.? Contact Jason Woofenden
Moving the alt declaration to the beginning of the function.
[st.git] / st.c
diff --git a/st.c b/st.c
index 5e7e4ac..2919082 100644 (file)
--- a/st.c
+++ b/st.c
@@ -1459,6 +1459,7 @@ tsetscroll(int t, int b) {
 void
 tsetmode(bool priv, bool set, int *args, int narg) {
        int *lim, mode;
+       bool alt;
 
        for(lim = args + narg; args < lim; ++args) {
                if(priv) {
@@ -1480,8 +1481,14 @@ tsetmode(bool priv, bool set, int *args, int narg) {
                        case 7: /* DECAWM -- Auto wrap */
                                MODBIT(term.mode, set, MODE_WRAP);
                                break;
-                       case 8:  /* DECARM -- Auto repeat (IGNORED) */
                        case 0:  /* Error (IGNORED) */
+                       case 2:  /* DECANM -- ANSI/VT52 (IGNORED) */
+                       case 3:  /* DECCOLM -- Column  (IGNORED) */
+                       case 4:  /* DECSCLM -- Scroll (IGNORED) */
+                       case 8:  /* DECARM -- Auto repeat (IGNORED) */
+                       case 18: /* DECPFF -- Printer feed (IGNORED) */
+                       case 19: /* DECPEX -- Printer extent (IGNORED) */
+                       case 42: /* DECNRCM -- National characters (IGNORED) */
                        case 12: /* att610 -- Start blinking cursor (IGNORED) */
                                break;
                        case 25: /* DECTCEM -- Text Cursor Enable Mode */
@@ -1496,7 +1503,7 @@ tsetmode(bool priv, bool set, int *args, int narg) {
                        case 1049: /* = 1047 and 1048 */
                        case 47:
                        case 1047: {
-                               bool alt = IS_SET(MODE_ALTSCREEN) != 0;
+                               alt = IS_SET(MODE_ALTSCREEN) != 0;
                                if(alt)
                                        tclearregion(0, 0, term.col-1, term.row-1);
                                if(set ^ alt)           /* set is always 1 or 0 */
@@ -1509,12 +1516,6 @@ tsetmode(bool priv, bool set, int *args, int narg) {
                                tcursor((set) ? CURSOR_SAVE : CURSOR_LOAD);
                                break;
                        default:
-                       /* case 2:  DECANM -- ANSI/VT52 (NOT SUPPOURTED) */
-                       /* case 3:  DECCOLM -- Column  (NOT SUPPORTED) */
-                       /* case 4:  DECSCLM -- Scroll (NOT SUPPORTED) */
-                       /* case 18: DECPFF -- Printer feed (NOT SUPPORTED) */
-                       /* case 19: DECPEX -- Printer extent (NOT SUPPORTED) */
-                       /* case 42: DECNRCM -- National characters (NOT SUPPORTED) */
                                fprintf(stderr,
                                        "erresc: unknown private set/reset mode %d\n",
                                        *args);