summaryrefslogtreecommitdiffstats
path: root/src/u_vars.c
diff options
context:
space:
mode:
authorJozanLeClerc <bousset.rudy@gmail.com>2020-09-15 19:59:41 +0200
committerJozanLeClerc <bousset.rudy@gmail.com>2020-09-15 19:59:41 +0200
commitca2e36781039eb7e9901ccde395600e7af87ff4f (patch)
tree8a9d85433e943fbbd079bc55700e048a54d9bf24 /src/u_vars.c
parenttype builtin fix (diff)
download42-minishell-ca2e36781039eb7e9901ccde395600e7af87ff4f.tar.gz
42-minishell-ca2e36781039eb7e9901ccde395600e7af87ff4f.tar.bz2
42-minishell-ca2e36781039eb7e9901ccde395600e7af87ff4f.tar.xz
42-minishell-ca2e36781039eb7e9901ccde395600e7af87ff4f.tar.zst
42-minishell-ca2e36781039eb7e9901ccde395600e7af87ff4f.zip
Huge fixes and stack stuff
Diffstat (limited to '')
-rw-r--r--src/u_vars.c18
1 files changed, 11 insertions, 7 deletions
diff --git a/src/u_vars.c b/src/u_vars.c
index 95c6ffa..97fc580 100644
--- a/src/u_vars.c
+++ b/src/u_vars.c
@@ -98,22 +98,26 @@ void
** varname[] wasn't found.
*/
-void
- u_get_var_value(char str[],
- const char varname[],
- size_t dstsize,
- t_msh *msh)
+uint8_t u_get_var_value(char str[],
+ const char varname[],
+ size_t dstsize,
+ t_msh *msh)
{
str[0] = C_NUL;
u_get_special_var(str, varname, dstsize, msh);
if (str[0] != C_NUL)
{
- return ;
+ return (0);
}
u_get_custom_var(str, varname, dstsize, msh);
if (str[0] != C_NUL)
{
- return ;
+ return (0);
}
u_get_frm_env(str, varname, dstsize, msh);
+ if (str[0] != C_NUL)
+ {
+ return (0);
+ }
+ return (1);
}