From 80ac4ddc2b5a3c11ddd499aaeb5cebdb7c070483 Mon Sep 17 00:00:00 2001 From: axel Date: Tue, 10 Oct 2006 00:16:08 +1000 Subject: [PATCH] Allow more than one argument to the commandline builtin. The arguments will be joined together using newlines darcs-hash:20061009141608-ac50b-546c0f5897670bb7e628d6e7c63d687eac261ee1.gz --- builtin_commandline.c | 25 +++++++++++++++++++++++-- 1 file changed, 23 insertions(+), 2 deletions(-) diff --git a/builtin_commandline.c b/builtin_commandline.c index b9e1fc074..4aaadb052 100644 --- a/builtin_commandline.c +++ b/builtin_commandline.c @@ -430,7 +430,7 @@ static int builtin_commandline( wchar_t **argv ) /* Check for invalid switch combinations */ - if( argc-woptind > 1 ) + if( cursor_mode && (argc-woptind > 1) ) { sb_append2( sb_err, @@ -570,7 +570,28 @@ static int builtin_commandline( wchar_t **argv ) case 1: { replace_part( begin, end, argv[woptind], append_mode ); - break; + break; + } + + default: + { + string_buffer_t sb; + int i; + + sb_init( &sb ); + + sb_append( &sb, argv[woptind] ); + + for( i=woptind+1; i