mirror of
https://github.com/fish-shell/fish-shell.git
synced 2024-11-26 02:13:38 +08:00
Fix segfault when using the 'set' command with no arguments
darcs-hash:20060502162830-ac50b-d3ab63c29a6daeaa62803923b060ec69942911f8.gz
This commit is contained in:
parent
d690a15b29
commit
92fde30c0c
|
@ -491,7 +491,7 @@ int builtin_set( wchar_t **argv )
|
|||
al_push(&values, argv[woptind++]);
|
||||
}
|
||||
|
||||
if( is_path_variable( dest ) )
|
||||
if( dest && is_path_variable( dest ) )
|
||||
{
|
||||
int i;
|
||||
int error = 0;
|
||||
|
|
6
common.c
6
common.c
|
@ -496,6 +496,12 @@ int contains_str( const wchar_t *a, ... )
|
|||
va_list va;
|
||||
int res = 0;
|
||||
|
||||
if( !a )
|
||||
{
|
||||
debug( 1, L"Warning: Called contains_str with null argument. This is a bug." );
|
||||
return 0;
|
||||
}
|
||||
|
||||
va_start( va, a );
|
||||
while( (arg=va_arg(va, wchar_t *) )!= 0 )
|
||||
{
|
||||
|
|
4
common.h
4
common.h
|
@ -181,9 +181,11 @@ void error_reset();
|
|||
const wchar_t *wsetlocale( int category, const wchar_t *locale );
|
||||
|
||||
/**
|
||||
Checks if \c needle is included in the list of strings specified
|
||||
Checks if \c needle is included in the list of strings specified. A warning is printed if needle is zero.
|
||||
|
||||
\param needle the string to search for in the list
|
||||
|
||||
\return zero is needle is not found, of if needle is null, non-zero otherwise
|
||||
*/
|
||||
int contains_str( const wchar_t *needle, ... );
|
||||
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
#include <stdarg.h>
|
||||
#include <wctype.h>
|
||||
#include <wchar.h>
|
||||
#include "common.h"
|
||||
|
||||
|
||||
/**
|
||||
Under curses, tputs expects an int (*func)(char) as its last
|
||||
|
|
Loading…
Reference in New Issue
Block a user