Skip to content

Commit

Permalink
Fix issue in error handling, reported to and fixed by Axel Liljencran…
Browse files Browse the repository at this point in the history
…tz. Change val[0] and body[0] in env universal to val[1] and body[1] to support compilation with Sun Studio. Change default prompt to use pekdon instead of whoami as it does not exist under Solaris.

darcs-hash:20070822080052-cac88-326332f0df7d17ddca4a4496c93728a47f19bba5.gz
  • Loading branch information
Claes Nästén committed Aug 22, 2007
1 parent 74a270e commit c2c4b24
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 7 deletions.
6 changes: 3 additions & 3 deletions builtin.c
Original file line number Diff line number Diff line change
Expand Up @@ -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]?argv[1]:L"<stdin>" );
_( L"%ls: Error while reading file '%ls'\n" ),
argv[0],
argv[1] );
}

/*
Expand Down
3 changes: 1 addition & 2 deletions env_universal_common.c
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@
typedef struct var_uni_entry
{
int export; /**< Whether the variable should be exported */
wchar_t val[0]; /**< The value of the variable */
wchar_t val[1]; /**< The value of the variable */
}
var_uni_entry_t;

Expand All @@ -113,7 +113,6 @@ void (*callback)( int type,
const wchar_t *key,
const wchar_t *val );


/**
Variable used by env_get_names to communicate auxiliary information
to add_key_to_hash
Expand Down
2 changes: 1 addition & 1 deletion env_universal_common.h
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ typedef struct
/**
Message body. The message must be allocated using enough memory to actually contain the message.
*/
char body[0];
char body[1];
}
message_t;

Expand Down
2 changes: 1 addition & 1 deletion reader.c
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ commence.
fish specific commands, meaning it will work even if fish is not
installed. This is used by read_i.
*/
#define DEFAULT_PROMPT L"whoami; echo @; hostname|cut -d . -f 1; echo \" \"; pwd; printf '> ';"
#define DEFAULT_PROMPT L"echo \"$USER@\"; hostname|cut -d . -f 1; echo \" \"; pwd; printf '> ';"

#define PROMPT_FUNCTION_NAME L"fish_prompt"

Expand Down

0 comments on commit c2c4b24

Please sign in to comment.