[hackers] [st] dump escseq if not handled. || Aur?lien Aptel

From: <hg_AT_suckless.org>
Date: Tue, 16 Jun 2009 08:34:20 +0000 (UTC)

changeset: 60:12caf70674d5
tag: tip
user: Aur?lien Aptel <aurelien.aptel_AT_gmail.com>
date: Tue Jun 16 12:34:10 2009 +0200
files: st.c
description:
dump escseq if not handled.

diff -r 75b74ec2265c -r 12caf70674d5 st.c
--- a/st.c Tue Jun 16 02:41:45 2009 +0200
+++ b/st.c Tue Jun 16 12:34:10 2009 +0200
@@ -591,10 +591,16 @@
 
 void
 eschandle(void) {
- /* escdump(); */
         switch(escseq.pre) {
+ default:
+ goto unknown_seq;
         case '[':
                 switch(escseq.mode) {
+ default:
+ unknown_seq:
+ fprintf(stderr, "erresc: unknown sequence\n");
+ escdump();
+ break;
                 case '@': /* Insert <n> blank char */
                         DEFAULT(escseq.arg[0], 1);
                         tinsertblank(escseq.arg[0]);
@@ -712,15 +718,13 @@
 void
 escdump(void) {
         int i;
- puts("------");
         printf("rawbuf : %s\n", escseq.buf);
         printf("prechar : %c\n", escseq.pre);
         printf("private : %c\n", escseq.priv ? '?' : ' ');
         printf("narg : %d\n", escseq.narg);
- if(escseq.narg) {
+ if(escseq.narg)
                 for(i = 0; i < escseq.narg; i++)
                         printf("\targ %d = %d\n", i, escseq.arg[i]);
- }
         printf("mode : %c\n", escseq.mode);
 }
 
Received on Tue Jun 16 2009 - 08:34:20 UTC

This archive was generated by hypermail 2.2.0 : Tue Jun 16 2009 - 08:36:05 UTC