summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJozanLeClerc <bousset.rudy@gmail.com>2020-04-21 22:45:45 +0200
committerJozanLeClerc <bousset.rudy@gmail.com>2020-04-21 22:45:45 +0200
commit1903646e160346bc2fb3cc617689500cee03ff12 (patch)
treeba461440ed54bb3cbf6c6f44ccf8339f3a6553a6
parentTryna export (diff)
download42-minishell-1903646e160346bc2fb3cc617689500cee03ff12.tar.gz
42-minishell-1903646e160346bc2fb3cc617689500cee03ff12.tar.bz2
42-minishell-1903646e160346bc2fb3cc617689500cee03ff12.tar.xz
42-minishell-1903646e160346bc2fb3cc617689500cee03ff12.tar.zst
42-minishell-1903646e160346bc2fb3cc617689500cee03ff12.zip
I'll finish export later
Diffstat (limited to '')
-rw-r--r--src/ft_b_echo.c5
-rw-r--r--src/ft_b_export.c13
-rw-r--r--src/ft_f_fail.c1
3 files changed, 13 insertions, 6 deletions
diff --git a/src/ft_b_echo.c b/src/ft_b_echo.c
index abaf564..c50bd8b 100644
--- a/src/ft_b_echo.c
+++ b/src/ft_b_echo.c
@@ -15,7 +15,10 @@
#include "ft_s_struct.h"
#include "ft_u_utils.h"
- /* TODO: norme, echo $variables, echo "quoted text" */
+/* TODO: norme, echo $variables, echo "quoted text", echo 'quoted text', */
+/* echo kill\nbackslash\nbut\nnot\nn, echo "quoted\nnew\nlines" */
+/* Might need to go full buffer */
+
uint8_t
ft_b_echo(char *args[],
diff --git a/src/ft_b_export.c b/src/ft_b_export.c
index be4d94d..767db08 100644
--- a/src/ft_b_export.c
+++ b/src/ft_b_export.c
@@ -50,25 +50,30 @@ uint8_t
ft_b_export(char *args[],
t_msh *msh)
{
- char **ptr;
const uint64_t argc = ft_get_argc((const char**)args);
- int8_t next;
+ char **ptr;
+ int8_t next;
+ uint8_t r;
if (argc == 0)
{
return (ft_b_env(NULL, msh));
}
ptr = args;
+ r = 0;
while (*ptr)
{
next = 0;
if (!ft_check_valid_identifier(*ptr))
{
ft_fail_identifier("export", *ptr);
+ next = 1;
+ r = 1;
}
- ft_check_equals(*ptr);
+ if (next == 0 && !ft_check_equals(*ptr))
+ next = 1;
ptr++;
}
/* TODO: finish export */
- return (0);
+ return (r);
}
diff --git a/src/ft_f_fail.c b/src/ft_f_fail.c
index 9a826ed..621702b 100644
--- a/src/ft_f_fail.c
+++ b/src/ft_f_fail.c
@@ -28,7 +28,6 @@ void
ft_write_fail(concern, FT_FAIL_NO_OPTIONS);
}
- /* TODO: export failed identifier `123' */
void
ft_fail_identifier(const char concern[],
const char identifier[])