diff --git a/complete.c b/complete.c index 8343ae8a6..79102a9c0 100644 --- a/complete.c +++ b/complete.c @@ -1965,6 +1965,9 @@ void complete( const wchar_t *cmd, CHECK( cmd, ); CHECK( comp, ); + +// debug( 1, L"Complete '%ls'", cmd ); + /** If we are completing a variable name or a tilde expansion user @@ -2062,7 +2065,7 @@ void complete( const wchar_t *cmd, prev_token = prev_begin ? wcsndup( prev_begin, prev_end - prev_begin ): wcsdup(L""); -// fwprintf( stderr, L"on_command: %d, %ls %ls\n", on_command, current_compmand, current_token ); +// debug( 0, L"on_command: %d, %ls %ls\n", on_command, current_command, current_token ); if( !had_cmd ) { on_command=1; diff --git a/main.c b/main.c index 5c3b32cfd..47231dc53 100644 --- a/main.c +++ b/main.c @@ -90,7 +90,7 @@ static int read_init() if( chdir( cwd ) == -1 ) { /* - If we can't change back to previos irectory, we'll stay in + If we can't change back to previos directory, we'll stay in ~. Should be a sane default behavior. */ } diff --git a/output.c b/output.c index 6a86f0705..9546c1712 100644 --- a/output.c +++ b/output.c @@ -123,6 +123,7 @@ static void output_destroy() void output_set_writer( int (*writer)(char) ) { + CHECK( writer, ); out = writer; } @@ -145,8 +146,6 @@ void set_color( int c, int c2 ) is_underline |= (c&FISH_COLOR_UNDERLINE)!=0; is_underline |= (c2&FISH_COLOR_UNDERLINE)!=0; -// debug( 1, L"WOO %d %d %d", is_bold, c&FISH_COLOR_BOLD,c2&FISH_COLOR_BOLD); - c = c&(~(FISH_COLOR_BOLD|FISH_COLOR_UNDERLINE)); c2 = c2&(~(FISH_COLOR_BOLD|FISH_COLOR_UNDERLINE)); @@ -367,9 +366,8 @@ int writeb( tputs_arg_t b ) int writembs( char *str ) { - if( !str ) - return 1; - + CHECK( str, 1 ); + return tputs(str,1,&writeb)==ERR?1:0; } @@ -410,6 +408,8 @@ int writech( wint_t ch ) void writestr( const wchar_t *str ) { char *pos; + + CHECK( str, ); // while( *str ) // writech( *str++ ); @@ -465,7 +465,11 @@ void writestr( const wchar_t *str ) void writestr_ellipsis( const wchar_t *str, int max_width ) { int written=0; - int tot = my_wcswidth(str); + int tot; + + CHECK( str, ); + + tot = my_wcswidth(str); if( tot <= max_width ) { @@ -497,11 +501,16 @@ void writestr_ellipsis( const wchar_t *str, int max_width ) int write_escaped_str( const wchar_t *str, int max_len ) { - wchar_t *out = escape( str, 1 ); + wchar_t *out; int i; - int len = my_wcswidth( out ); + int len; int written=0; + CHECK( str, 0 ); + + out = escape( str, 1 ); + len = my_wcswidth( out ); + if( max_len && (max_len < len)) { for( i=0; (written+wcwidth(out[i]))<=(max_len-1); i++ ) diff --git a/share/fish.in b/share/fish.in index a4226237d..a7e6e1dd0 100644 --- a/share/fish.in +++ b/share/fish.in @@ -24,7 +24,7 @@ for idx in (seq (count $PATH)) end if count $erase_idx >/dev/null - set -e PATH[(echo $erase_idx)] + set -e PATH[(echo $erase_idx)] end #