summaryrefslogtreecommitdiffstats
path: root/src/c_utils_next.c
diff options
context:
space:
mode:
authorsalad <fmoenne-@student.le-101.fr>2020-12-18 20:18:38 +0100
committersalad <fmoenne-@student.le-101.fr>2020-12-18 20:18:38 +0100
commitbbc9757dccbc50fb051ca3cff585a9100023b1b1 (patch)
treecbf0c5280545d47cea0d7885e94c711edd4c5cc7 /src/c_utils_next.c
parentMerge branch 'leaktarace' of jozanleclerc.xyz:42-minishell into leaktarace (diff)
download42-minishell-bbc9757dccbc50fb051ca3cff585a9100023b1b1.tar.gz
42-minishell-bbc9757dccbc50fb051ca3cff585a9100023b1b1.tar.bz2
42-minishell-bbc9757dccbc50fb051ca3cff585a9100023b1b1.tar.xz
42-minishell-bbc9757dccbc50fb051ca3cff585a9100023b1b1.tar.zst
42-minishell-bbc9757dccbc50fb051ca3cff585a9100023b1b1.zip
qweqweqweqwe
Diffstat (limited to 'src/c_utils_next.c')
-rw-r--r--src/c_utils_next.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/c_utils_next.c b/src/c_utils_next.c
index 27a88db..07d1c88 100644
--- a/src/c_utils_next.c
+++ b/src/c_utils_next.c
@@ -19,6 +19,21 @@
#include "c_utils.h"
#include "d_define.h"
+void c_set_ptr_norme(char key, t_bool *sw, char **p, char **context)
+{
+ if ((key == -1 && *p - *context != 0) || key == 1)
+ {
+ *p += (key == -1) ? (2 * key) : (0);
+ while (*sw == FALSE && ((key == -1 && *p - *context != 0) || key == 1)
+ && **p != C_LF && **p != C_NUL)
+ *p += key;
+ if (*sw == TRUE)
+ *sw = FALSE;
+ if (*p - *context != 0 && **p != C_NUL)
+ *p += 1;
+ }
+}
+
short c_set_key(char *buf)
{
if (((*((unsigned int *)buf)) == UP_K) ||