30 if (!ft_isalpha(str[0]) && str[0] !=
'_')
35 if (!ft_isalnum(str[i]) && str[i] !=
'_')
57 if (ft_strncmp(current->
key, key, -1) == 0)
71 current = current->
next;
93 if (args[i][0] ==
'-' && args[i][1])
95 ft_putstr_fd(
"minishell: unset: -", STDERR_FILENO);
96 ft_putchar_fd(args[i][1], STDERR_FILENO);
97 ft_putstr_fd(
": invalid option\n", STDERR_FILENO);
int builtin_unset(char **args, t_env **env)
Implement the unset command.
static void remove_env_node(t_env **env, char *key)
Remove an env node by key from the doubly linked list.
static int is_valid_unset_identifier(char *str)
Validate an identifier for unset.
Shell builtin commands prototypes.
Environment variable (doubly linked list)
char * value
Value (NULL if export only)
struct s_env * prev
Previous node.
struct s_env * next
Next node.