]> git.dkaiser.de - 42/minishell.git/commitdiff
fixed norm tester 133 remove .vs
authorChristopher Uhlig <chuhlig@3-H-8.42heilbronn.de>
Mon, 20 Jan 2025 18:32:10 +0000 (19:32 +0100)
committerChristopher Uhlig <chuhlig@3-H-8.42heilbronn.de>
Mon, 20 Jan 2025 18:32:10 +0000 (19:32 +0100)
13 files changed:
.vscode/c_cpp_properties.json [deleted file]
.vscode/launch.json [deleted file]
.vscode/settings.json [deleted file]
.vscode/tasks.json [deleted file]
include/minishell.h
include/token.h
src/builtins_part_one.c
src/builtins_part_two.c
src/env.c
src/interpreter.c
src/new_token.c
src/parse_cmd.c
src/parser.c

diff --git a/.vscode/c_cpp_properties.json b/.vscode/c_cpp_properties.json
deleted file mode 100644 (file)
index 94b2ae4..0000000
+++ /dev/null
@@ -1,18 +0,0 @@
-{
-       "configurations": [
-         {
-               "name": "macos-clang-x64",
-               "includePath": [
-                 "${workspaceFolder}/**"
-               ],
-               "compilerPath": "/usr/bin/clang",
-               "cStandard": "${default}",
-               "cppStandard": "${default}",
-               "intelliSenseMode": "macos-clang-x64",
-               "compilerArgs": [
-                 ""
-               ]
-         }
-       ],
-       "version": 4
-  }
\ No newline at end of file
diff --git a/.vscode/launch.json b/.vscode/launch.json
deleted file mode 100644 (file)
index 86fa44a..0000000
+++ /dev/null
@@ -1,13 +0,0 @@
-{
-       "version": "0.2.0",
-       "configurations": [
-         {
-               "name": "C/C++ Runner: Debug Session",
-               "type": "lldb",
-               "request": "launch",
-               "args": [],
-               "cwd": "/Users/chuhlig/Desktop/merged_minishell/",
-               "program": "/Users/chuhlig/Desktop/merged_minishell/minishell"
-         }
-       ]
-  }
\ No newline at end of file
diff --git a/.vscode/settings.json b/.vscode/settings.json
deleted file mode 100644 (file)
index e43ecab..0000000
+++ /dev/null
@@ -1,64 +0,0 @@
-{
-       "C_Cpp_Runner.cCompilerPath": "clang",
-       "C_Cpp_Runner.cppCompilerPath": "clang++",
-       "C_Cpp_Runner.debuggerPath": "lldb",
-       "C_Cpp_Runner.cStandard": "",
-       "C_Cpp_Runner.cppStandard": "",
-       "C_Cpp_Runner.msvcBatchPath": "",
-       "C_Cpp_Runner.useMsvc": false,
-       "C_Cpp_Runner.warnings": [
-         "-Wall",
-         "-Wextra",
-         "-Wpedantic",
-         "-Wshadow",
-         "-Wformat=2",
-         "-Wcast-align",
-         "-Wconversion",
-         "-Wsign-conversion",
-         "-Wnull-dereference"
-       ],
-       "C_Cpp_Runner.msvcWarnings": [
-         "/W4",
-         "/permissive-",
-         "/w14242",
-         "/w14287",
-         "/w14296",
-         "/w14311",
-         "/w14826",
-         "/w44062",
-         "/w44242",
-         "/w14905",
-         "/w14906",
-         "/w14263",
-         "/w44265",
-         "/w14928"
-       ],
-       "C_Cpp_Runner.enableWarnings": true,
-       "C_Cpp_Runner.warningsAsError": false,
-       "C_Cpp_Runner.compilerArgs": [],
-       "C_Cpp_Runner.linkerArgs": [],
-       "C_Cpp_Runner.includePaths": [],
-       "C_Cpp_Runner.includeSearch": [
-         "*",
-         "**/*"
-       ],
-       "C_Cpp_Runner.excludeSearch": [
-         "**/build",
-         "**/build/**",
-         "**/.*",
-         "**/.*/**",
-         "**/.vscode",
-         "**/.vscode/**"
-       ],
-       "C_Cpp_Runner.useAddressSanitizer": false,
-       "C_Cpp_Runner.useUndefinedSanitizer": false,
-       "C_Cpp_Runner.useLeakSanitizer": false,
-       "C_Cpp_Runner.showCompilationTime": false,
-       "C_Cpp_Runner.useLinkTimeOptimization": false,
-       "C_Cpp_Runner.msvcSecureNoWarnings": false,
-       "files.associations": {
-               "minishell.h": "c",
-               "debug_tools.h": "c",
-               "token.h": "c"
-       }
-  }
\ No newline at end of file
diff --git a/.vscode/tasks.json b/.vscode/tasks.json
deleted file mode 100644 (file)
index 4ede37a..0000000
+++ /dev/null
@@ -1,29 +0,0 @@
-{
-    "tasks": [
-        {
-            "type": "cppbuild",
-            "label": "C/C++: clang build active file",
-            "command": "/usr/bin/clang",
-            "args": [
-                "-fcolor-diagnostics",
-                "-fansi-escape-codes",
-                "-g",
-                "${file}",
-                "-o",
-                "${fileDirname}/${fileBasenameNoExtension}"
-            ],
-            "options": {
-                "cwd": "${fileDirname}"
-            },
-            "problemMatcher": [
-                "$gcc"
-            ],
-            "group": {
-                "kind": "build",
-                "isDefault": true
-            },
-            "detail": "Task generated by Debugger."
-        }
-    ],
-    "version": "2.0.0"
-}
\ No newline at end of file
index e9810bd8f38bfdca34df5e60925df8766eb43c76..356df7a6fd207abe8f9add53a1387b9110ed9f4b 100644 (file)
@@ -6,7 +6,7 @@
 /*   By: chuhlig <chuhlig@student.42.fr>            +#+  +:+       +#+        */
 /*                                                +#+#+#+#+#+   +#+           */
 /*   Created: 2024/06/22 17:14:49 by dkaiser           #+#    #+#             */
-/*   Updated: 2025/01/20 18:41:11 by dkaiser          ###   ########.fr       */
+/*   Updated: 2025/01/20 19:12:03 by chuhlig          ###   ########.fr       */
 /*                                                                            */
 /* ************************************************************************** */
 
@@ -42,7 +42,7 @@ int                           eval(t_node *node, t_env **env);
 char                   *get_cmd_path(char *cmd, t_env *env, int *return_code);
 int                            execute_cmd(t_cmd *cmd, t_env **env);
 char                   *format_string(char *str, t_env *env, int is_literal);
-void                           set_return_code(int return_code, t_env **env);
+void                   set_return_code(int return_code, t_env **env);
 int                            handle_redirections(t_redirection *redirs);
 void                   *error(int err_code, char *err_text, int exit_code,
                                        int *ret_code);
index bb7ea9445e3dec5c086e03a42be77f37de152507..2e8da3501424eb093070eb2ded8bc8d297c727be 100644 (file)
@@ -6,7 +6,7 @@
 /*   By: chuhlig <chuhlig@student.42.fr>            +#+  +:+       +#+        */
 /*                                                +#+#+#+#+#+   +#+           */
 /*   Created: 2024/06/27 13:27:18 by dkaiser           #+#    #+#             */
-/*   Updated: 2025/01/20 12:37:59 by chuhlig          ###   ########.fr       */
+/*   Updated: 2025/01/20 19:10:30 by chuhlig          ###   ########.fr       */
 /*                                                                            */
 /* ************************************************************************** */
 
@@ -43,9 +43,9 @@ t_token                                               *new_str_token(char *str, t_token *previous,
                                                                t_token *next);
 t_token                                                *new_redir_token(int type, t_token *previous,
                                                                t_token *next);
-
+void                                           free_tokens(t_token *tokens);
 void                                           free_token(t_token *token);
-
+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);
index 629cc8752e010db21f1bb21acd2a70eec71bbb68..11989cc9e7fb763d3afce59c2fdab856559e5468 100644 (file)
@@ -6,7 +6,7 @@
 /*   By: chuhlig <chuhlig@student.42.fr>            +#+  +:+       +#+        */
 /*                                                +#+#+#+#+#+   +#+           */
 /*   Created: 2024/08/09 17:01:16 by chuhlig           #+#    #+#             */
-/*   Updated: 2025/01/20 17:05:19 by chuhlig          ###   ########.fr       */
+/*   Updated: 2025/01/20 19:07:18 by chuhlig          ###   ########.fr       */
 /*                                                                            */
 /* ************************************************************************** */
 
@@ -26,15 +26,7 @@ int  unset(char **av, t_env **env)
                prev = NULL;
                while (current)
                {
-                       if ((!ft_strcmp(current->name, av[i])) && (!ft_strcmp("?", av[1])))
-                       {
-                               if (prev)
-                                       prev->next = current->next;
-                               else
-                                       *env = current->next;
-                               free_env_node(current);
-                               break ;
-                       }
+                       if (ft_strcmp(current->name, av[i]) == 0)
                        {
                                if (prev)
                                        prev->next = current->next;
index d3c0929d9becb3c3f8d8c158436f8441fdcf6d51..e461861d50d66f89ac2724d67a32d8cba9d77045 100644 (file)
@@ -6,7 +6,7 @@
 /*   By: chuhlig <chuhlig@student.42.fr>            +#+  +:+       +#+        */
 /*                                                +#+#+#+#+#+   +#+           */
 /*   Created: 2024/10/25 20:52:16 by chuhlig           #+#    #+#             */
-/*   Updated: 2025/01/18 18:57:12 by chuhlig          ###   ########.fr       */
+/*   Updated: 2025/01/20 19:12:33 by chuhlig          ###   ########.fr       */
 /*                                                                            */
 /* ************************************************************************** */
 
@@ -59,7 +59,7 @@ void  update_pwd(t_env **env)
 int    cd(t_env **env, char **av)
 {
        t_env   *current;
-  
+
        current = *env;
        if (av[1] == NULL)
        {
index 63a0f8a51e2a3aa2d0bce37e4bee768a56327dd8..572040c290814efc617795eba732f535c6f6dde5 100644 (file)
--- a/src/env.c
+++ b/src/env.c
@@ -6,7 +6,7 @@
 /*   By: chuhlig <chuhlig@student.42.fr>            +#+  +:+       +#+        */
 /*                                                +#+#+#+#+#+   +#+           */
 /*   Created: 2024/10/17 14:31:07 by chuhlig           #+#    #+#             */
-/*   Updated: 2025/01/20 15:05:49 by chuhlig          ###   ########.fr       */
+/*   Updated: 2025/01/20 19:12:43 by chuhlig          ###   ########.fr       */
 /*                                                                            */
 /* ************************************************************************** */
 
@@ -78,4 +78,4 @@ void  free_env_node(t_env *node)
        free(node->name);
        free(node->value);
        free(node);
-}
\ No newline at end of file
+}
index 6d71022a1c0c4c701b63910f2e3e68ed60980db2..44f4b950fd320821f7a5259d8f36eb79b484b9d1 100644 (file)
@@ -6,7 +6,7 @@
 /*   By: chuhlig <chuhlig@student.42.fr>            +#+  +:+       +#+        */
 /*                                                +#+#+#+#+#+   +#+           */
 /*   Created: 2024/12/17 19:15:49 by chuhlig           #+#    #+#             */
-/*   Updated: 2025/01/20 12:48:49 by chuhlig          ###   ########.fr       */
+/*   Updated: 2025/01/20 19:12:49 by chuhlig          ###   ########.fr       */
 /*                                                                            */
 /* ************************************************************************** */
 
@@ -53,4 +53,3 @@ int   eval(t_node *node, t_env **env)
 {
        return (eval_rec(node, env, STDIN_FILENO));
 }
-
index 6431c7d2b39f4f2006d4515403c7ac89264fde4d..bd65b9dbbaf15a4218c3c8cb09d4ec7ee93bd904 100644 (file)
@@ -6,7 +6,7 @@
 /*   By: chuhlig <chuhlig@student.42.fr>            +#+  +:+       +#+        */
 /*                                                +#+#+#+#+#+   +#+           */
 /*   Created: 2024/06/27 14:29:44 by dkaiser           #+#    #+#             */
-/*   Updated: 2024/08/29 15:30:52 by chuhlig          ###   ########.fr       */
+/*   Updated: 2025/01/20 19:12:57 by chuhlig          ###   ########.fr       */
 /*                                                                            */
 /* ************************************************************************** */
 
@@ -50,28 +50,3 @@ t_token      *new_redir_token(int type, t_token *previous, t_token *next)
        token->content.redir_type = type;
        return (token);
 }
-
-// void        ft_append_token(int type, t_token **list)// but we need somewhere token/node head initialize with nul
-// {
-//     t_token *node;
-//     t_token *last_node;
-
-//     if (!list)
-//             return ;
-//     node = malloc(sizeof(t_token));
-//     if (!node)
-//             return ;
-//     node->next = NULL;
-//     node->type = type;
-//     if (!*list)
-//     {
-//             *list = node;
-//             node->previous = NULL;
-//     }
-//     else
-//     {
-//             last_node = ft_lstlast(*list);
-//             last_node->next = node;
-//             node->previous = last_node;
-//     }
-// }
\ No newline at end of file
index b30d1267883fb1fd1789625f0894e7a1e5eabd86..6505384c40e42f9d8f0c0ee2f9d9d385a94fe102 100644 (file)
@@ -6,7 +6,7 @@
 /*   By: chuhlig <chuhlig@student.42.fr>            +#+  +:+       +#+        */
 /*                                                +#+#+#+#+#+   +#+           */
 /*   Created: 2024/07/08 15:06:25 by dkaiser           #+#    #+#             */
-/*   Updated: 2025/01/20 17:57:50 by dkaiser          ###   ########.fr       */
+/*   Updated: 2025/01/20 19:09:21 by chuhlig          ###   ########.fr       */
 /*                                                                            */
 /* ************************************************************************** */
 
index 75f1c64d27b4c0a1d25646f0ea34a430f1434fb8..13ab10d3cc84654d72f850cf2989dfe4ae43341d 100644 (file)
@@ -6,14 +6,14 @@
 /*   By: chuhlig <chuhlig@student.42.fr>            +#+  +:+       +#+        */
 /*                                                +#+#+#+#+#+   +#+           */
 /*   Created: 2024/06/29 15:53:29 by dkaiser           #+#    #+#             */
-/*   Updated: 2025/01/20 17:57:20 by dkaiser          ###   ########.fr       */
+/*   Updated: 2025/01/20 19:13:31 by chuhlig          ###   ########.fr       */
 /*                                                                            */
 /* ************************************************************************** */
 
-#include "env.h"
 #include "libft.h"
 #include "minishell.h"
 #include "token.h"
+#include "env.h"
 
 static t_token *find_token_by_type(t_token *tokens, int type);
 t_token                        *split_at_first(t_token **tokens, int type);