diff options
| author | Charles <sircharlesaze@gmail.com> | 2020-06-13 10:34:30 +0200 |
|---|---|---|
| committer | nass1pro <nass1pro@gmail.com> | 2020-06-13 11:46:02 +0200 |
| commit | 72ec3b700e8e3142eb9e79098a357f01a6085589 (patch) | |
| tree | d866162477544c8ff96c33c57ae119b458432d17 /src/lexer | |
| parent | d971bd8d16608f316396aba7a579d0b1f1af5aeb (diff) | |
| download | minishell-72ec3b700e8e3142eb9e79098a357f01a6085589.tar.gz minishell-72ec3b700e8e3142eb9e79098a357f01a6085589.tar.bz2 minishell-72ec3b700e8e3142eb9e79098a357f01a6085589.zip | |
Fixing multiple definition of lexer
Diffstat (limited to 'src/lexer')
| -rw-r--r-- | src/lexer/lexer.c | 6 | ||||
| -rw-r--r-- | src/lexer/main.c | 29 |
2 files changed, 32 insertions, 3 deletions
diff --git a/src/lexer/lexer.c b/src/lexer/lexer.c index 994ea55..185ff83 100644 --- a/src/lexer/lexer.c +++ b/src/lexer/lexer.c @@ -163,8 +163,8 @@ static t_ftlst *create_token_list(char *input, t_ftlst **lst) t_ftlst *lexer(char *input) { - t_ftlst **lst; - int i; + t_ftlst **lst; + /* int i; */ if (!input) return (0); @@ -172,7 +172,7 @@ t_ftlst *lexer(char *input) if (!lst) return(0); *lst = create_token_list(input, lst); - i = ft_lstsize(*lst); + /* i = ft_lstsize(*lst); */ free(lst); return (0); } diff --git a/src/lexer/main.c b/src/lexer/main.c new file mode 100644 index 0000000..753969d --- /dev/null +++ b/src/lexer/main.c @@ -0,0 +1,29 @@ + +#include "lexer.h" + +/*int main(int argc, char **argv) +{ + char *input; + + if (!(input = malloc(sizeof(char) * ft_strlen(argv[1]) + 1))) + return(0); + ft_strlcpy(input, argv[1], ft_strlen(argv[1]) + 1); + + lexer(input); + free(input); + exit(0); + return (0); +}*/ +/* +#include <stdio.h> +int main(int argc, char **argv, char **envp) +{ + printf("ARGV:\n"); + for (int i = 0; i < argc; i++) + printf("[%d] %s\n", i, argv[i]); + printf("\nENV:\n"); + for (int i = 0; envp[i] != NULL && i < 10; i++) + printf("[%d] %s\n", i, envp[i]); + return 0; +} +*/ |
