Skip to content

Commit

Permalink
setenv, unsetenv
Browse files Browse the repository at this point in the history
  • Loading branch information
wrightkhlebisol committed Jul 25, 2023
1 parent f82505d commit 1d4e4c6
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions main.c
Original file line number Diff line number Diff line change
Expand Up @@ -243,9 +243,12 @@ void init_env_list(envstruct *head)
*
* Return: void
*/
void setenv_cmd(char **argv)
void setenv_cmd(char **argv, envstruct *head)
{

if (argv != NULL)
insert_end(head, &(*argv[0]), &(*argv[1]));
else
perror("Error");
}

/**
Expand All @@ -254,9 +257,12 @@ void setenv_cmd(char **argv)
*
* Return: void
*/
void unsetenv_cmd(char **argv)
void unsetenv_cmd(char **argv, envstruct *head)
{

if (argv != NULL)
remove_value(&head, &(*argv[0]));
else
perror("Error");
}

/**
Expand Down

0 comments on commit 1d4e4c6

Please sign in to comment.