The error condition was duplicated in two different switches.
This new version centralized the error handling in only one place.
void
strhandle(void) {
char *p = NULL;
void
strhandle(void) {
char *p = NULL;
strparse();
narg = strescseq.narg;
strparse();
narg = strescseq.narg;
+ par = atoi(strescseq.args[0]);
switch(strescseq.type) {
case ']': /* OSC -- Operating System Command */
switch(strescseq.type) {
case ']': /* OSC -- Operating System Command */
- switch(i = atoi(strescseq.args[0])) {
case 0:
case 1:
case 2:
if(narg > 1)
xsettitle(strescseq.args[1]);
case 0:
case 1:
case 2:
if(narg > 1)
xsettitle(strescseq.args[1]);
case 4: /* color set */
if(narg < 3)
break;
case 4: /* color set */
if(narg < 3)
break;
- break;
- default:
- fprintf(stderr, "erresc: unknown str ");
- strdump();
- break;
}
break;
case 'k': /* old title set compatibility */
xsettitle(strescseq.args[0]);
}
break;
case 'k': /* old title set compatibility */
xsettitle(strescseq.args[0]);
case 'P': /* DSC -- Device Control String */
case '_': /* APC -- Application Program Command */
case '^': /* PM -- Privacy Message */
case 'P': /* DSC -- Device Control String */
case '_': /* APC -- Application Program Command */
case '^': /* PM -- Privacy Message */
- default:
- fprintf(stderr, "erresc: unknown str ");
- strdump();
- /* die(""); */
- break;
+
+ fprintf(stderr, "erresc: unknown str ");
+ strdump();