diff --git a/builtin.c b/builtin.c index 7438aa08b..35c7c9ef8 100644 --- a/builtin.c +++ b/builtin.c @@ -11,13 +11,13 @@ 2). Add a line like hash_put( &builtin, L"NAME", &builtin_NAME ); to builtin_init. This will enable the parser to find the builtin function. - 3). Add a line like hash_put( desc, L"NAME", L"Frobble the bloogle" ); to the proper part of builtin_get_desc, containing a short description of what the builtin does. This description is used by the completion system. + 3). Add a line like hash_put( desc, L"NAME", L"Bla bla bla" ); to the proper part of builtin_get_desc, containing a short description of what the builtin does. This description is used by the completion system. - 4). Create a file names doc_src/NAME.txt, contining the manual for the builtin in Doxygen-format. Check the other builtin manuals for proper syntax. + 4). Create a file doc_src/NAME.txt, containing the manual for the builtin in Doxygen-format. Check the other builtin manuals for proper syntax. - 5). Add an entry to the BUILTIN_DOC_SRC variable of Makefile.in. Note that the entries should be sorted alpabetically! + 5). Add an entry to the BUILTIN_DOC_SRC variable of Makefile.in. Note that the entries should be sorted alphabetically! - 6). Add an entry to the manual at the builtin-overview subsection + 6). Add an entry to the manual at the builtin-overview subsection. Note that the entries should be sorted alphabetically! */ @@ -248,8 +248,6 @@ static int builtin_bind( wchar_t **argv ) for( i=woptind; i '%ls', set PWD to '%ls'\n", argv[1]?argv[1]:L"-", dir, env_get( L"PWD" ) ); - free( dir ); return res; @@ -2438,7 +2433,6 @@ static void builtin_jobs_print( job_t *j, int mode, int header ) sb_printf( sb_out, L"%d%%\t", cpu_use(j) ); #endif sb_append2( sb_out, job_is_stopped(j)?L"stopped\t":L"running\t", -// job_is_completed(j)?L"completed\t":L"unfinished\t", j->command, L"\n", (void *)0 ); } @@ -2865,7 +2859,6 @@ static int builtin_end( wchar_t **argv ) { parser_pop_block(); } -// fwprintf( stderr, L"End with status %d\n", proc_get_last_status() ); /* diff --git a/parser.c b/parser.c index ef4e6b3a5..4ae3a86ee 100644 --- a/parser.c +++ b/parser.c @@ -598,6 +598,8 @@ wchar_t *get_filename( const wchar_t *cmd ) { wchar_t *path; + debug( 2, L"get_filename( '%ls' )", cmd ); + if(wcschr( cmd, '/' ) != 0 ) { if( waccess( cmd, X_OK )==0 ) @@ -1316,7 +1318,7 @@ static int parse_job( process_t *p, block_t *prev_block = current_block; -// debug( 2, L"begin parse_job()\n" ); + debug( 2, L"begin parse_job()\n" ); al_init( &args ); current_tokenizer_pos = tok_get_pos( tok ); @@ -1330,6 +1332,8 @@ static int parse_job( process_t *p, { nxt = expand_one( wcsdup(tok_last( tok )), EXPAND_SKIP_SUBSHELL | EXPAND_SKIP_VARIABLES); + debug( 2, L"command '%ls' -> '%ls'", tok_last( tok ), nxt?nxt:L"0" ); + if( nxt == 0 ) { error( SYNTAX_ERROR, @@ -1567,6 +1571,9 @@ static int parse_job( process_t *p, { p->actual_cmd = get_filename( (wchar_t *)al_get( &args, 0 ) ); + + debug( 2, L"filename '%ls' -> '%ls'", (wchar_t *)al_get( &args, 0 ), p->actual_cmd?p->actual_cmd:L"0" ); + /* Check if the specified command exists */ @@ -1972,8 +1979,6 @@ int eval( const wchar_t *cmd, io_data_t *io, int block_type ) io_data_t *prev_io = block_io; block_io = io; - debug( 2, L"Eval command %ls", cmd ); - job_reap( 0 ); if( !cmd )