Skip to content

Commit

Permalink
fix =, to first =
Browse files Browse the repository at this point in the history
  • Loading branch information
alexisvisco committed Jun 21, 2018
1 parent 6f78602 commit d463d67
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/builtins/b_env_set.c
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ int b_set_env_a(t_hashtable *envs, char *str, t_shell *shell)
{
char **splitted;

splitted = ft_strsplit(str, '=');
if (size_tab(splitted) >= 2)
splitted = strsplit_first(str, "=");
if (size_tab(splitted) >= 2 && splitted[0] && splitted[1])
b_set_env_b(envs, splitted[0], splitted[1], shell);
else
{
Expand Down
2 changes: 1 addition & 1 deletion src/builtins/variables/core_variable.c
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ int create_variable(char *assignation)
t_var *var;
t_res res;

assign = ft_strsplit(assignation, '=');
assign = strsplit_first(assignation, "=");
var = (t_var *)ft_memalloc(sizeof(t_var));
if (ft_strlen(assign[0]) > 32)
{
Expand Down
2 changes: 1 addition & 1 deletion src/init/set_env.c
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ void set_env(char **environ)
i = -1;
while (environ[++i])
{
splitted = ft_strsplit(environ[i], '=');
splitted = strsplit_first(environ[i], "=");
if (splitted && splitted[0] && splitted[1])
{
c = ft_char_to_str('$');
Expand Down

0 comments on commit d463d67

Please sign in to comment.