Let the commands/simple/tr.c understand about '\t', '\r', and '\n'.

This commit is contained in:
Kees van Reeuwijk 2010-03-12 09:58:44 +00:00
parent 23e97af1b4
commit 3efbb8f133

View File

@ -169,6 +169,15 @@ register unsigned char *buffer;
i++;
} while (i < 4 && *arg >= '0' && *arg <= '7');
*buffer++ = ac;
} else if( *arg == 't' ){
arg++;
*buffer++ = '\t';
} else if( *arg == 'r' ){
arg++;
*buffer++ = '\r';
} else if( *arg == 'n' ){
arg++;
*buffer++ = '\n';
} else if (*arg != '\0')
*buffer++ = *arg++;
} else if (*arg == '[') {