aboutsummaryrefslogtreecommitdiff
path: root/src/builtin/export.c
diff options
context:
space:
mode:
authorCharles Cabergs <me@cacharle.xyz>2020-09-13 21:01:18 +0200
committerCharles Cabergs <me@cacharle.xyz>2020-09-13 21:01:18 +0200
commitc51d31b8b751585153500729c25ae2f02d179e45 (patch)
treeeab34e14508f5a2a3ad2c5d06c56afdd7ba72e9e /src/builtin/export.c
parent490237aece240c05b5a9035665a88327e1be87ed (diff)
downloadminishell-c51d31b8b751585153500729c25ae2f02d179e45.tar.gz
minishell-c51d31b8b751585153500729c25ae2f02d179e45.tar.bz2
minishell-c51d31b8b751585153500729c25ae2f02d179e45.zip
Refactoring eval file structure, Added comment to builtin
Diffstat (limited to 'src/builtin/export.c')
-rw-r--r--src/builtin/export.c14
1 files changed, 13 insertions, 1 deletions
diff --git a/src/builtin/export.c b/src/builtin/export.c
index f19842e..4ac6626 100644
--- a/src/builtin/export.c
+++ b/src/builtin/export.c
@@ -6,7 +6,7 @@
/* By: charles <charles@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2020/04/01 17:11:34 by charles #+# #+# */
-/* Updated: 2020/09/13 14:16:28 by charles ### ########.fr */
+/* Updated: 2020/09/13 20:22:10 by charles ### ########.fr */
/* */
/* ************************************************************************** */
@@ -17,6 +17,11 @@
#include "minishell.h"
+/*
+** \brief Put an environment variable in the format "declare -x id=value" of bash
+** \param s Full variable (id=value)
+*/
+
static void st_put_declare_x(char *s)
{
char *equal_ptr;
@@ -51,6 +56,13 @@ static void st_put_declare_x(char *s)
ft_putchar('\n');
}
+/*
+** \brief Export variables to the environment
+** \param argv arguments
+** \param env environment
+** \return a status code or EVAL_FATAL on fatal error
+*/
+
int builtin_export(char **argv, t_env env)
{
int status;