Adopt posix_spawn (!)

Rewrite IO chains to be a vector of pointers, instead of a linked list
Removed io_transmogrify
This commit is contained in:
ridiculousfish
2012-08-15 00:57:56 -07:00
parent ad6645c48d
commit 61686aff34
27 changed files with 805 additions and 579 deletions

View File

@@ -216,8 +216,10 @@ static struct config_paths_t determine_config_directory_paths(const char *argv0)
static int read_init(const struct config_paths_t &paths)
{
parser_t &parser = parser_t::principal_parser();
parser.eval( L"builtin . " + paths.data + L"/config.fish 2>/dev/null", 0, TOP );
parser.eval( L"builtin . " + paths.sysconf + L"/config.fish 2>/dev/null", 0, TOP );
const io_chain_t empty_ios;
parser.eval( L"builtin . " + paths.data + L"/config.fish 2>/dev/null", empty_ios, TOP );
parser.eval( L"builtin . " + paths.sysconf + L"/config.fish 2>/dev/null", empty_ios, TOP );
/*
We need to get the configuration directory before we can source the user configuration file
@@ -232,7 +234,7 @@ static int read_init(const struct config_paths_t &paths)
{
wcstring config_dir_escaped = escape_string( config_dir, 1 );
wcstring eval_buff = format_string(L"builtin . %ls/config.fish 2>/dev/null", config_dir_escaped.c_str());
parser.eval( eval_buff, 0, TOP );
parser.eval( eval_buff, empty_ios, TOP );
}
return 1;
@@ -453,12 +455,13 @@ int main( int argc, char **argv )
if (g_log_forks)
printf("%d: g_fork_count: %d\n", __LINE__, g_fork_count);
const io_chain_t empty_ios;
if( read_init(paths) )
{
if( cmd != 0 )
{
wchar_t *cmd_wcs = str2wcs( cmd );
res = parser.eval( cmd_wcs, 0, TOP );
res = parser.eval( cmd_wcs, empty_ios, TOP );
free(cmd_wcs);
reader_exit(0, 0);
}
@@ -466,7 +469,7 @@ int main( int argc, char **argv )
{
if( my_optind == argc )
{
res = reader_read( STDIN_FILENO, 0 );
res = reader_read( STDIN_FILENO, empty_ios );
}
else
{
@@ -511,7 +514,7 @@ int main( int argc, char **argv )
free( rel_filename );
free( abs_filename );
res = reader_read( fd, 0 );
res = reader_read( fd, empty_ios );
if( res )
{