fix source index
This commit is contained in:
parent
fbe2c51d41
commit
b188c4c6ac
@ -12,12 +12,12 @@
|
||||
|
||||
#include "minishell.h"
|
||||
|
||||
static int get_var_len(const char *source, int idx)
|
||||
static int get_var_len(const char *source)
|
||||
{
|
||||
int i;
|
||||
|
||||
i = 0;
|
||||
while (expander_character_valid(source[idx + i]))
|
||||
i = 1;
|
||||
while (expander_character_valid(source[i]))
|
||||
i++;
|
||||
return (i);
|
||||
}
|
||||
@ -40,6 +40,8 @@ int expander_expand_dollar(char *src, char *dest, int *j, t_list *variables)
|
||||
}
|
||||
}
|
||||
else
|
||||
v_len = get_var_len(src, (*j) + 1);
|
||||
{
|
||||
v_len = get_var_len(src);
|
||||
}
|
||||
return (v_len);
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user