From 151943f89e36103dd3802764a2fa895eb7bf5c77 Mon Sep 17 00:00:00 2001 From: liljencrantz Date: Sun, 9 Sep 2007 08:24:53 +1000 Subject: [PATCH] Indentation, typo and formating fixes. Very minor patch. darcs-hash:20070908222453-75c98-2236d962f0c9016820063e871fbbeaa42f36ef22.gz --- builtin.c | 6 +++--- doc_src/emit.txt | 10 +++------- exec.c | 15 ++++++++------- main.c | 20 ++++++++++++-------- 4 files changed, 26 insertions(+), 25 deletions(-) diff --git a/builtin.c b/builtin.c index 2dbb3be2a..0aff1d7e3 100644 --- a/builtin.c +++ b/builtin.c @@ -2526,9 +2526,9 @@ static int builtin_source( wchar_t ** argv ) if( res ) { sb_printf( sb_err, - _( L"%ls: Error while reading file '%ls'\n" ), - argv[0], - argv[1] ); + _( L"%ls: Error while reading file '%ls'\n" ), + argv[0], + argv[1]?argv[1]:L"" ); } /* diff --git a/doc_src/emit.txt b/doc_src/emit.txt index 231439993..78d36917c 100644 --- a/doc_src/emit.txt +++ b/doc_src/emit.txt @@ -9,15 +9,11 @@ The emit builtin fires a generic fish event. Such events can be caught by specia \subsection emit-example Example -The following code first defines an event handler for the generig +The following code first defines an event handler for the generic event named 'test_event', and then emits an event of that type. -
-function event_test --on-event test_event
+
function event_test --on-event test_event
     echo event test!!!
 end
 
-emit test_event
-
-
- +emit test_event
\ No newline at end of file diff --git a/exec.c b/exec.c index 0ca0e754a..7e7acade9 100644 --- a/exec.c +++ b/exec.c @@ -668,13 +668,14 @@ static int set_child_group( job_t *j, process_t *p, int print_errors ) if( getpgid( p->pid) != j->pgid && print_errors ) { debug( 1, - _( L"Could not send process %d, '%ls' in job %d, '%ls' from group %d to group %d" ), - p->pid, - p->argv[0], - j->job_id, - j->command, - getpgid( p->pid), - j->pgid ); + _( L"Could not send process %d, '%ls' in job %d, '%ls' from group %d to group %d" ), + p->pid, + p->argv[0], + j->job_id, + j->command, + getpgid( p->pid), + j->pgid ); + wperror( L"setpgid" ); res = -1; } diff --git a/main.c b/main.c index 55452661a..8a69a8136 100644 --- a/main.c +++ b/main.c @@ -368,8 +368,12 @@ int main( int argc, char **argv ) rel_filename = str2wcs( file ); abs_filename = wrealpath( rel_filename, 0 ); + if( !abs_filename ) + { abs_filename = wcsdup(rel_filename); + } + reader_push_current_filename( intern( abs_filename ) ); free( rel_filename ); free( abs_filename ); @@ -379,16 +383,16 @@ int main( int argc, char **argv ) if( res ) { debug( 1, - _(L"Error while reading file %ls\n"), - reader_current_filename()?reader_current_filename(): _(L"Standard input") ); + _(L"Error while reading file %ls\n"), + reader_current_filename()?reader_current_filename(): _(L"Standard input") ); } reader_pop_current_filename(); } } } - + proc_fire_event( L"PROCESS_EXIT", EVENT_EXIT, getpid(), res ); - + history_destroy(); proc_destroy(); builtin_destroy(); @@ -397,12 +401,12 @@ int main( int argc, char **argv ) parser_destroy(); wutil_destroy(); event_destroy(); - + halloc_util_destroy(); - + env_destroy(); - + intern_free_all(); - + return res?STATUS_UNKNOWN_COMMAND:proc_get_last_status(); }