summaryrefslogtreecommitdiffstats
path: root/src/m_argv.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/m_argv.c')
-rw-r--r--src/m_argv.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/m_argv.c b/src/m_argv.c
index 7661ef7..bd415ec 100644
--- a/src/m_argv.c
+++ b/src/m_argv.c
@@ -56,6 +56,8 @@ static void m_read_script(char *const argv[], t_msh *msh)
if ((fd = open(*(argv + 1), O_RDONLY)) == -1)
f_open_file(*(argv + 1), msh);
msh->fd = fd;
+ msh->argv = (char**)(argv + 1);
+ msh->argc -= 1;
msh->ret = m_loop(fd, msh);
close(fd);
}
@@ -75,7 +77,7 @@ uint8_t m_argv(int argc, char *const argv[], t_msh *msh)
if (*(argv + 2) == NULL)
{
ft_dprintf(STDERR_FILENO, "%s: %s: option requires an argument\n",
- msh->shname, FT_OPT_COMMAND);
+ msh->argv[0], FT_OPT_COMMAND);
return (2);
}
msh->ret = m_comm(*(argv + 2), msh);