mirror of
https://github.com/fish-shell/fish-shell
synced 2025-01-13 13:39:02 +00:00
Replaced some calls to unescape with unescape_string
This commit is contained in:
parent
9bcc7df96f
commit
294fbc8309
4 changed files with 13 additions and 14 deletions
|
@ -423,15 +423,13 @@ static int builtin_complete( parser_t &parser, wchar_t **argv )
|
|||
case 'p':
|
||||
case 'c':
|
||||
{
|
||||
wchar_t *a = unescape( woptarg, 1);
|
||||
if( a )
|
||||
wcstring tmp = woptarg;
|
||||
if (unescape_string(tmp, 1))
|
||||
{
|
||||
if (opt=='p')
|
||||
path.push_back(a);
|
||||
path.push_back(tmp);
|
||||
else
|
||||
cmd.push_back(a);
|
||||
|
||||
free(a);
|
||||
cmd.push_back(tmp);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
|
@ -496,7 +496,7 @@ const wchar_t *wcsfuncname( const wchar_t *str )
|
|||
|
||||
int wcsvarchr( wchar_t chr )
|
||||
{
|
||||
return ( (iswalnum(chr)) || (chr == L'_' ));
|
||||
return iswalnum(chr) || chr == L'_';
|
||||
}
|
||||
|
||||
|
||||
|
|
2
exec.cpp
2
exec.cpp
|
@ -359,7 +359,7 @@ static void safe_launch_process( process_t *p, const char *actual_cmd, char **ar
|
|||
}
|
||||
|
||||
/**
|
||||
This function is similar to launch_process, except it is not called after a fork (i.e. it is only calls exec) and therefore it can allocate memory.
|
||||
This function is similar to launch_process, except it is not called after a fork (i.e. it only calls exec) and therefore it can allocate memory.
|
||||
*/
|
||||
static void launch_process_nofork( process_t *p )
|
||||
{
|
||||
|
|
|
@ -108,22 +108,23 @@ static int indent( wcstring &out, const wcstring &in, int flags )
|
|||
int next_indent = indent;
|
||||
is_command = 0;
|
||||
|
||||
wchar_t *unesc = unescape( last, UNESCAPE_SPECIAL );
|
||||
wcstring unesc = last;
|
||||
unescape_string(unesc, UNESCAPE_SPECIAL);
|
||||
|
||||
if( parser_keywords_is_block( unesc ) )
|
||||
if( parser_keywords_is_block(unesc))
|
||||
{
|
||||
next_indent++;
|
||||
}
|
||||
else if( wcscmp( unesc, L"else" ) == 0 )
|
||||
else if (unesc == L"else")
|
||||
{
|
||||
indent--;
|
||||
}
|
||||
/* case should have the same indent level as switch*/
|
||||
else if( wcscmp( unesc, L"case" ) == 0 )
|
||||
else if (unesc == L"case")
|
||||
{
|
||||
indent--;
|
||||
}
|
||||
else if( wcscmp( unesc, L"end" ) == 0 )
|
||||
else if (unesc == L"end")
|
||||
{
|
||||
indent--;
|
||||
next_indent--;
|
||||
|
|
Loading…
Reference in a new issue