mirror of
https://github.com/fish-shell/fish-shell.git
synced 2026-06-06 00:41:15 -03:00
Fix segfault caused by a backslash followed by a null inside single quotes
darcs-hash:20060615005931-ac50b-4c6be7129dfd2c3a5759a811b605ad32fceff758.gz
This commit is contained in:
@@ -72,12 +72,15 @@ static int is_potential_path( const wchar_t *path )
|
||||
void *context = halloc( 0, 0 );
|
||||
|
||||
tilde = expand_tilde( wcsdup(path) );
|
||||
halloc_register( context, tilde );
|
||||
|
||||
unescaped = unescape( tilde, 1 );
|
||||
if( unescaped )
|
||||
{
|
||||
|
||||
// debug( 1, L"%ls -> %ls ->%ls", path, tilde, unescaped );
|
||||
|
||||
halloc_register( context, unescaped );
|
||||
halloc_register( context, tilde );
|
||||
|
||||
for( in = out = unescaped; *in; in++ )
|
||||
{
|
||||
@@ -110,7 +113,7 @@ static int is_potential_path( const wchar_t *path )
|
||||
}
|
||||
*out = 0;
|
||||
|
||||
if( !has_magic )
|
||||
if( !has_magic && wcslen( unescaped ) )
|
||||
{
|
||||
int must_be_dir = 0;
|
||||
DIR *dir;
|
||||
@@ -151,6 +154,7 @@ static int is_potential_path( const wchar_t *path )
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
halloc_free( context );
|
||||
|
||||
|
||||
Reference in New Issue
Block a user