Added env hashmap with build_env function to build envp
This commit is contained in:
parent
f35e986145
commit
f86947a852
54 changed files with 2010 additions and 105 deletions
26
stdme/src/string/str_compare.c
Normal file
26
stdme/src/string/str_compare.c
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
/* ************************************************************************** */
|
||||
/* */
|
||||
/* ::: :::::::: */
|
||||
/* str_compare.c :+: :+: :+: */
|
||||
/* +:+ +:+ +:+ */
|
||||
/* By: maiboyer <maiboyer@student.42.fr> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2023/11/04 18:53:47 by maiboyer #+# #+# */
|
||||
/* Updated: 2024/05/04 18:37:40 by maiboyer ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
#include "me/string/str_compare.h"
|
||||
|
||||
// PLEASE FIX THIS FUNCTION IF NEEDED !
|
||||
bool str_compare(t_const_str lhs, t_const_str rhs)
|
||||
{
|
||||
t_usize index;
|
||||
|
||||
if (lhs == NULL || rhs == NULL)
|
||||
return (lhs == rhs);
|
||||
index = 0;
|
||||
while (lhs[index] && rhs[index] && lhs[index] == rhs[index])
|
||||
index++;
|
||||
return ((t_i32)(t_u8)lhs[index] - (t_i32)(t_u8)rhs[index]);
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue