Offer option to dump environment in tix-build(1) recovery shell.

This commit is contained in:
Jonas 'Sortie' Termansen 2014-01-15 00:15:35 +01:00
parent 687096ec8a
commit 9f34e60cbc
1 changed files with 9 additions and 1 deletions

View File

@ -968,6 +968,7 @@ retry_ask_recovery_method:
fprintf(output, "2. Try again\n");
fprintf(output, "3. Pretend command was successful\n");
fprintf(output, "4. Run $SHELL -i to investigate\n");
fprintf(output, "5. Dump environment\n");
fprintf(output, "\n");
fprintf(output, "Please choose one: [%i] ", default_selection);
fflush(output);
@ -992,7 +993,7 @@ retry_ask_recovery_method:
goto retry_ask_recovery_method;
}
if ( 4 < selection )
if ( 5 < selection )
{
error(0, 0, "error: `%i' is not an allowed choice\n", selection);
goto retry_ask_recovery_method;
@ -1024,6 +1025,13 @@ retry_ask_recovery_method:
return true;
}
if ( selection == 5 )
{
for ( size_t i = 0; environ[i]; i++ )
fprintf(output, "%s\n", environ[i]);
goto retry_ask_recovery_method;
}
default_selection = 2;
goto retry_ask_recovery_method;