MiniDevil
As beautiful as a shell
Implements unset: removes env variables.
More...
Include dependency graph for builtin_unset.c:Implements unset: removes env variables.
Definition in file builtin_unset.c.
Functions | |
| static int | is_valid_unset_identifier (char *str) |
| Validate an identifier for unset. More... | |
| static void | remove_env_node (t_env **env, char *key) |
| Remove an env node by key from the doubly linked list. More... | |
| int | builtin_unset (char **args, t_env **env) |
Implement the unset command. More... | |
|
static |
Validate an identifier for unset.
Must start with alpha or _ followed by alnum or _ only
| str | String to validate |
Definition at line 24 of file builtin_unset.c.
Referenced by builtin_unset().
Here is the caller graph for this function:
|
static |
Remove an env node by key from the doubly linked list.
Finds the node matching the key and unlinks it from the list + frees
| env | |
| key |
Definition at line 50 of file builtin_unset.c.
References t_env::key, t_env::next, t_env::prev, and t_env::value.
Referenced by builtin_unset().
Here is the caller graph for this function:| int builtin_unset | ( | char ** | args, |
| t_env ** | env | ||
| ) |
Implement the unset command.
Remove named variables from environment
-) return error 2| args | NULL terminated arg array with arg[0] = "unset" |
| env | Pointer to env list head (nodes will be removed) |
Definition at line 86 of file builtin_unset.c.
References is_valid_unset_identifier(), and remove_env_node().
Referenced by exec_builtin().
Here is the call graph for this function:
Here is the caller graph for this function: