summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJozanLeClerc <bousset.rudy@gmail.com>2020-08-26 17:16:32 +0200
committerJozanLeClerc <bousset.rudy@gmail.com>2020-08-26 17:16:32 +0200
commit6450dd00b959c8b74cdb5c151588072e33bad91e (patch)
tree050b088b10a6e3b6169c2c53e6d49973d779b3a5 /src
parentStrings comp done (diff)
download42-minishell-6450dd00b959c8b74cdb5c151588072e33bad91e.tar.gz
42-minishell-6450dd00b959c8b74cdb5c151588072e33bad91e.tar.bz2
42-minishell-6450dd00b959c8b74cdb5c151588072e33bad91e.tar.xz
42-minishell-6450dd00b959c8b74cdb5c151588072e33bad91e.tar.zst
42-minishell-6450dd00b959c8b74cdb5c151588072e33bad91e.zip
New comparison strings stuff
Diffstat (limited to 'src')
-rw-r--r--src/b_sqb.c3
-rw-r--r--src/b_sqb_str.c9
2 files changed, 10 insertions, 2 deletions
diff --git a/src/b_sqb.c b/src/b_sqb.c
index 8ac1f16..34d5c06 100644
--- a/src/b_sqb.c
+++ b/src/b_sqb.c
@@ -69,7 +69,8 @@ static uint8_t
ret = b_sqb_file_tests(id, argv);
else if (id == FT_ID_SQB_NT || id == FT_ID_SQB_OT)
ret = b_sqb_double_file_tests(id, argv);
- else if (id == FT_ID_SQB_Z || id == FT_ID_SQB_EQUA || id == FT_ID_SQB_DIFF)
+ else if (id == FT_ID_SQB_N || id == FT_ID_SQB_Z ||
+ id == FT_ID_SQB_EQUA || id == FT_ID_SQB_DIFF)
ret = b_sqb_str(id, argv);
return (ret);
}
diff --git a/src/b_sqb_str.c b/src/b_sqb_str.c
index 7c6a160..cc7e4ed 100644
--- a/src/b_sqb_str.c
+++ b/src/b_sqb_str.c
@@ -33,13 +33,20 @@ uint8_t
b_sqb_str(uint8_t id,
char *argv[])
{
- if (id == FT_ID_SQB_Z)
+ if (id == FT_ID_SQB_N)
{
if (argv[1][0] != '\0')
return (0);
else
return (1);
}
+ else if (id == FT_ID_SQB_Z)
+ {
+ if (argv[1][0] == '\0')
+ return (0);
+ else
+ return (1);
+ }
if (b_sqb_str_comp(id, argv[0], argv[2]) == TRUE)
return (0);
return (1);