summaryrefslogtreecommitdiffstats
path: root/src/b_sqb.c
diff options
context:
space:
mode:
authorJozanLeClerc <bousset.rudy@gmail.com>2020-08-26 18:17:02 +0200
committerJozanLeClerc <bousset.rudy@gmail.com>2020-08-26 18:17:02 +0200
commitdcd2a41e545cbee2a4487e28f684d19f9aa79877 (patch)
treef9508a15520475ba1e19a91a088f7facb7640f00 /src/b_sqb.c
parentNumbers are goodio, now errcheck (diff)
download42-minishell-dcd2a41e545cbee2a4487e28f684d19f9aa79877.tar.gz
42-minishell-dcd2a41e545cbee2a4487e28f684d19f9aa79877.tar.bz2
42-minishell-dcd2a41e545cbee2a4487e28f684d19f9aa79877.tar.xz
42-minishell-dcd2a41e545cbee2a4487e28f684d19f9aa79877.tar.zst
42-minishell-dcd2a41e545cbee2a4487e28f684d19f9aa79877.zip
Err check in progress
Diffstat (limited to '')
-rw-r--r--src/b_sqb.c12
1 files changed, 4 insertions, 8 deletions
diff --git a/src/b_sqb.c b/src/b_sqb.c
index fb52e00..a5a0fd5 100644
--- a/src/b_sqb.c
+++ b/src/b_sqb.c
@@ -14,6 +14,7 @@
#include <stdint.h>
#include <unistd.h>
+#include "b_sqb_err.h"
#include "b_sqb_file.h"
#include "b_sqb_nbr.h"
#include "b_sqb_str.h"
@@ -21,12 +22,6 @@
#include "s_struct.h"
#include "u_utils.h"
-static void
- b_sqb_unexpected_operator(const char op[])
-{
- ft_dprintf(STDERR_FILENO, "[: %s: unexpected operator\n", op);
-}
-
static uint8_t
b_get_sqb_id(char *argv[],
t_msh *msh)
@@ -61,10 +56,11 @@ static uint8_t
id = b_get_sqb_id(argv, msh);
if (id == FT_ID_SQB_COUNT)
{
- b_sqb_unexpected_operator(argv[0]);
+ ft_dprintf(STDERR_FILENO, "[: %s: unexpected operator\n", argv[0]);
return (2);
}
- /* TODO: check errors */
+ if (b_sqb_err_check(id, argv) != 0)
+ return (2);
ret = 0;
if (id < FT_ID_SQB_NT && id != FT_ID_SQB_Z && id != FT_ID_SQB_N)
ret = b_sqb_file_tests(id, argv);