aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDominik Kaiser2025-01-25 15:57:16 +0100
committerGitHub2025-01-25 15:57:16 +0100
commit8fb5e2839cb7eb7bb72f577577afafcdbdc8a714 (patch)
treef44fffea0ef290f9bdf79448c90d794ba97b8ca4
parent21874e1446ccd08f4433870a69dbe1c08f8331a9 (diff)
parentbd8c817797d5f2b1affe6957ffc51846a38e70ec (diff)
downloadminishell-8fb5e2839cb7eb7bb72f577577afafcdbdc8a714.tar.gz
minishell-8fb5e2839cb7eb7bb72f577577afafcdbdc8a714.zip
Merge branch 'main' into memleakfix
-rw-r--r--include/debug_tools.h2
-rw-r--r--include/minishell.h2
-rw-r--r--include/token.h1
-rw-r--r--src/builtins_part_two.c2
-rw-r--r--src/debug_tools.c2
-rw-r--r--src/env_tools.c4
-rw-r--r--src/main.c4
-rw-r--r--src/new_node.c2
-rw-r--r--src/new_token.c2
-rw-r--r--src/repl.c1
10 files changed, 12 insertions, 10 deletions
diff --git a/include/debug_tools.h b/include/debug_tools.h
index 9a24875..a6f44f5 100644
--- a/include/debug_tools.h
+++ b/include/debug_tools.h
@@ -23,6 +23,8 @@
void dbg(char *str);
void panic(char *msg);
+
void print_token_list(t_token *token_list);
+
#endif
diff --git a/include/minishell.h b/include/minishell.h
index 354d5b9..6961815 100644
--- a/include/minishell.h
+++ b/include/minishell.h
@@ -30,7 +30,7 @@
int init(void);
int init_signal_handling(void);
-void repl(const char *prompt, t_env **env);
+void repl(const char *prompt, t_env **env, int *promptflag);
t_node *parse(t_token *tokens, t_env **env);
t_node *parse_cmd(t_token *tokens, t_env **env);
diff --git a/include/token.h b/include/token.h
index fb9633d..226c9ac 100644
--- a/include/token.h
+++ b/include/token.h
@@ -49,7 +49,6 @@ void free_token_and_connect(t_token *token);
void tokenizer(char *s, t_token **token_list,
char quote_check);
void print_token(t_token *token);
-
void free_token2(t_token *token);
void free_token_and_connect2(t_token *token);
diff --git a/src/builtins_part_two.c b/src/builtins_part_two.c
index 2382f25..ede48de 100644
--- a/src/builtins_part_two.c
+++ b/src/builtins_part_two.c
@@ -6,7 +6,7 @@
/* By: chuhlig <chuhlig@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2024/10/25 20:52:16 by chuhlig #+# #+# */
-/* Updated: 2025/01/21 18:44:03 by chuhlig ### ########.fr */
+/* Updated: 2025/01/20 19:12:33 by chuhlig ### ########.fr */
/* */
/* ************************************************************************** */
diff --git a/src/debug_tools.c b/src/debug_tools.c
index 3c38cd6..8668fad 100644
--- a/src/debug_tools.c
+++ b/src/debug_tools.c
@@ -13,8 +13,6 @@
#include "debug_tools.h"
#include <stdio.h>
#include <stdarg.h>
-#include "token.h"
-#include <stdio.h>
void dbg(char *msg)
{
diff --git a/src/env_tools.c b/src/env_tools.c
index b2e7873..25e21ce 100644
--- a/src/env_tools.c
+++ b/src/env_tools.c
@@ -3,10 +3,10 @@
/* ::: :::::::: */
/* env_tools.c :+: :+: :+: */
/* +:+ +:+ +:+ */
-/* By: chuhlig <chuhlig@student.42.fr> +#+ +:+ +#+ */
+/* By: dkaiser <dkaiser@student.42heilbronn.de +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2025/01/15 16:14:31 by dkaiser #+# #+# */
-/* Updated: 2025/01/22 14:13:02 by chuhlig ### ########.fr */
+/* Updated: 2025/01/15 16:15:10 by dkaiser ### ########.fr */
/* */
/* ************************************************************************** */
diff --git a/src/main.c b/src/main.c
index 9cd1b39..f759de7 100644
--- a/src/main.c
+++ b/src/main.c
@@ -14,9 +14,11 @@
int main(int argc, char *argv[], char *envp[])
{
- t_env *env;
+ t_env *env;
+ static int promptflag;
env = NULL;
+ promptflag = 0;
if (!argc && !argv)
return (1);
if (init())
diff --git a/src/new_node.c b/src/new_node.c
index f0383a2..b2ab7ea 100644
--- a/src/new_node.c
+++ b/src/new_node.c
@@ -6,7 +6,7 @@
/* By: chuhlig <chuhlig@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2024/06/27 11:21:03 by dkaiser #+# #+# */
-/* Updated: 2025/01/22 17:01:05 by dkaiser ### ########.fr */
+/* Updated: 2025/01/20 17:59:01 by dkaiser ### ########.fr */
/* */
/* ************************************************************************** */
diff --git a/src/new_token.c b/src/new_token.c
index c9bd28c..c5497b4 100644
--- a/src/new_token.c
+++ b/src/new_token.c
@@ -6,7 +6,7 @@
/* By: chuhlig <chuhlig@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2024/06/27 14:29:44 by dkaiser #+# #+# */
-/* Updated: 2025/01/24 18:46:05 by chuhlig ### ########.fr */
+/* Updated: 2025/01/20 19:12:57 by chuhlig ### ########.fr */
/* */
/* ************************************************************************** */
diff --git a/src/repl.c b/src/repl.c
index 3f4435d..a0b7864 100644
--- a/src/repl.c
+++ b/src/repl.c
@@ -26,6 +26,7 @@ void repl(const char *prompt, t_env **env)
t_token *token_list;
t_node *ast;
+ (*promptflag)++;
while (1)
{
input = readline(prompt);