]> Zhao Yanbai Git Server - minix.git/commitdiff
Let the commands/simple/tr.c understand about '\t', '\r', and '\n'.
authorKees van Reeuwijk <reeuwijk@few.vu.nl>
Fri, 12 Mar 2010 09:58:44 +0000 (09:58 +0000)
committerKees van Reeuwijk <reeuwijk@few.vu.nl>
Fri, 12 Mar 2010 09:58:44 +0000 (09:58 +0000)
commands/simple/tr.c

index 3f013418aef5ce99ec2c3108ea44625971fd1153..c7adcb3be0a5177adabe215f44085fd7073bb7ee 100644 (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 == '[') {