From 76bafbef2aafec7fb5938395388d41263be38908 Mon Sep 17 00:00:00 2001 From: axel Date: Wed, 19 Apr 2006 20:08:30 +1000 Subject: [PATCH] Make the read builtin accept 0 parameters and drop the input instead of showing an error message darcs-hash:20060419100830-ac50b-50f96925481bb29ad840fb12240ef9b9b86d18c4.gz --- builtin.c | 47 +++++++++++++++++++---------------------------- 1 file changed, 19 insertions(+), 28 deletions(-) diff --git a/builtin.c b/builtin.c index fa64356d7..584b973ea 100644 --- a/builtin.c +++ b/builtin.c @@ -1468,20 +1468,6 @@ static int builtin_read( wchar_t **argv ) return 1; } - if( woptind == argc ) - { - sb_printf( sb_err, - BUILTIN_ERR_MISSING, - argv[0] ); - - sb_append2( sb_err, - parser_current_line(), - L"\n", - (void *)0 ); - builtin_print_help( argv[0], sb_err ); - return 1; - } - /* Verify all variable names */ @@ -1512,10 +1498,6 @@ static int builtin_read( wchar_t **argv ) */ i=woptind; - ifs = env_get( L"IFS" ); - if( ifs == 0 ) - ifs = L""; - /* Check if we should read interactively using \c reader_readline() */ @@ -1593,20 +1575,29 @@ static int builtin_read( wchar_t **argv ) sb_destroy( &sb ); } - wchar_t *state; - - nxt = wcstok( buff, (i