summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorsalad <fmoenne-@student.le-101.fr>2020-11-10 19:20:56 +0100
committersalad <fmoenne-@student.le-101.fr>2020-11-10 19:20:56 +0100
commit952cd19005763cab8f95df45437c91cc7497f063 (patch)
tree5b4d5a994e4f4dfc05197e6a64c3476db34538e4
parentnrom fixeeeeeeeeeeeeeeeeeeeeeeedd (diff)
download42-minishell-952cd19005763cab8f95df45437c91cc7497f063.tar.gz
42-minishell-952cd19005763cab8f95df45437c91cc7497f063.tar.bz2
42-minishell-952cd19005763cab8f95df45437c91cc7497f063.tar.xz
42-minishell-952cd19005763cab8f95df45437c91cc7497f063.tar.zst
42-minishell-952cd19005763cab8f95df45437c91cc7497f063.zip
ctrl+d fixxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxedd
-rw-r--r--src/c_init.c13
-rw-r--r--src/retbin67 -> 0 bytes
2 files changed, 13 insertions, 0 deletions
diff --git a/src/c_init.c b/src/c_init.c
index 0133f7b..1e55f7e 100644
--- a/src/c_init.c
+++ b/src/c_init.c
@@ -22,8 +22,13 @@
#include "c_keys.h"
#include "c_input.h"
#include "c_utils.h"
+#include "b_exit.h"
#include "s_struct.h"
+#include "s_com.h"
+#include "s_line.h"
+#include "s_destroy.h"
#include "m_prompt.h"
+#include "m_loop.h"
short
c_set_term_raw(char mode)
@@ -80,6 +85,14 @@ static short
return (c_end_key(ft_strlen(line), tcaps->plen, tcaps));
else if ((*((unsigned int *)buf)) == CTRL_L)
return (c_ctrl_l(line, tcaps, msh));
+ else if ((*((unsigned int *)buf)) == CTRL_D &&
+ line[0] == '\0')
+ {
+ c_set_term_raw(0);
+ write(1, "exit\n", 5);
+ exit(msh->ret);
+ return (1);
+ }
else
return (0);
}
diff --git a/src/ret b/src/ret
deleted file mode 100644
index 42d8826..0000000
--- a/src/ret
+++ /dev/null
Binary files differ