mirror of
https://github.com/reactos/reactos.git
synced 2024-12-30 19:14:31 +00:00
clean up/simplify 'type' command some more and don't append command-terminating carriage-return to the output buffer.
svn path=/trunk/; revision=10973
This commit is contained in:
parent
540291d651
commit
cd3894b51d
1 changed files with 10 additions and 11 deletions
|
@ -270,22 +270,21 @@ int main( int argc, char **argv ) {
|
||||||
char* dst = p;
|
char* dst = p;
|
||||||
while ( *src )
|
while ( *src )
|
||||||
{
|
{
|
||||||
if ( *src == '\\' )
|
|
||||||
{
|
|
||||||
src++;
|
|
||||||
char c = *src++;
|
char c = *src++;
|
||||||
|
if ( c == '\r' || c == '\n' ) break;
|
||||||
|
if ( c == '\\' )
|
||||||
|
{
|
||||||
|
c = *src++;
|
||||||
switch ( c )
|
switch ( c )
|
||||||
{
|
{
|
||||||
case 'b': *dst++ = '\b'; break;
|
case 'b': c = '\b'; break;
|
||||||
case 'n': *dst++ = '\n'; break;
|
case 'n': c = '\n'; break;
|
||||||
case 'r': *dst++ = '\r'; break;
|
case 'r': c = '\r'; break;
|
||||||
case 't': *dst++ = '\t'; break;
|
case 't': c = '\t'; break;
|
||||||
case 'v': *dst++ = '\v'; break;
|
case 'v': c = '\v'; break;
|
||||||
default: *dst++ = c; break;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
*dst++ = c;
|
||||||
*dst++ = *src++;
|
|
||||||
}
|
}
|
||||||
*dst = '\0';
|
*dst = '\0';
|
||||||
if ( (err = OskitTCPSend ( conn, (OSK_PCHAR)p, strlen(p), (OSK_UINT*)&bytin, 0 ))
|
if ( (err = OskitTCPSend ( conn, (OSK_PCHAR)p, strlen(p), (OSK_UINT*)&bytin, 0 ))
|
||||||
|
|
Loading…
Reference in a new issue