From 3a01a095ada34cf088523b0302dafa2bde7e3461 Mon Sep 17 00:00:00 2001 From: JozanLeClerc Date: Fri, 11 Dec 2020 18:37:28 +0100 Subject: Done --- TODO.org | 3 ++- src/m_loop.c | 5 ++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/TODO.org b/TODO.org index 2cd48f0..f4d8383 100644 --- a/TODO.org +++ b/TODO.org @@ -68,7 +68,8 @@ ** DONE .minishellrc ** DONE .minishell_history ** DONE history builtin -** TODO $_ +** DONE $_ + CLOSED: [2020-12-11 Fri 18:37] ** TODO Parse error before p_line for scripts ** DONE Norm [2/2] CLOSED: [2020-10-03 Sat 14:46] diff --git a/src/m_loop.c b/src/m_loop.c index e658593..18636da 100644 --- a/src/m_loop.c +++ b/src/m_loop.c @@ -67,10 +67,9 @@ static void m_parse_and_run_line(char line[], while (msh->com->argv != NULL && msh->com->argv[i] != NULL) i++; if (msh->com->argv != NULL && msh->com->argv[0] != NULL) - ft_dprintf(1, "\r[%s]\n", msh->com->argv[i]); + u_subst_var_value("$_", msh->com->argv[i - 1], msh); else - ft_dprintf(1, "\r[%s]\n", msh->com->bin); - /* u_subst_var_value("$_", const char *newval, msh); */ + u_subst_var_value("$_", msh->com->bin, msh); } e_line_block(msh); s_com_destroy(&msh->com); -- cgit v1.2.3