mirror of
https://github.com/fish-shell/fish-shell.git
synced 2026-06-02 14:01:20 -03:00
Implemented process expansion on OS X
Also fixed issue where process expansion would always fail for processes with spaces Fixes https://github.com/fish-shell/fish-shell/issues/56
This commit is contained in:
34
common.cpp
34
common.cpp
@@ -136,6 +136,40 @@ wcstring_list_t completions_to_wcstring_list( const std::vector<completion_t> &l
|
||||
return strings;
|
||||
}
|
||||
|
||||
int fgetws2(wcstring *s, FILE *f)
|
||||
{
|
||||
int i=0;
|
||||
wint_t c;
|
||||
|
||||
while( 1 )
|
||||
{
|
||||
errno=0;
|
||||
|
||||
c = getwc( f );
|
||||
|
||||
if( errno == EILSEQ )
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
switch( c )
|
||||
{
|
||||
/* End of line */
|
||||
case WEOF:
|
||||
case L'\n':
|
||||
case L'\0':
|
||||
return i;
|
||||
/* Ignore carriage returns */
|
||||
case L'\r':
|
||||
break;
|
||||
|
||||
default:
|
||||
i++;
|
||||
s->push_back((wchar_t)c);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
int fgetws2( wchar_t **b, int *len, FILE *f )
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user