char *g_str = "\\G", *n_str = "\\N", *e_str = "\\E", *h_str = "\\H", *t_str = "\\T";
int g_len = 2, n_len = 2, e_len = 2, h_len = 2, t_len = 2, newlen = 0;
+ /* prepare substitution strings */
switch (agobjkind(obj)) {
case AGGRAPH:
g_str = ((graph_t *)obj)->name;
break;
case 'T':
newlen += t_len;
- break;
+ break;
+ default: /* leave other escape sequences unmodified, e.g. \n \l \r */
+ newlen += 2;
}
} else {
newlen++;
case 'H':
for (t = h_str; (*p = *t++); p++);
break;
- default:
+ default: /* leave other escape sequences unmodified, e.g. \n \l \r */
*p++ = '\\';
*p++ = c;
break;