diff --git a/lexer.c b/lexer.c index 8228d31..ed97ef9 100644 --- a/lexer.c +++ b/lexer.c @@ -1,6 +1,4 @@ #include "lexer.h" -#include -#include #define HTML_BALISE_LEN 12 @@ -81,34 +79,45 @@ void go_back(void){ } char* getParam(const char* word, int len, char* cursor, int* size){ - printf("looking for '%s' word in %d char.\n", word, len); + char* res = NULL; + int found = 0; + len--; + do { - printf("cursor: '%c' len: '%d'.\n", *cursor, len); - int succes = 0; - for (int i=0; itype = token_by_name(balise); if (token->type == A){ - printf("cursor status before passing param: '%c'.\n", *cursor); token->value = getParam("href", sizeof("href"), cursor, &token->len); } /*else if (token->type == IMG){ int len, srclen, altlen; diff --git a/main.c b/main.c index 2e2e262..db08e5a 100644 --- a/main.c +++ b/main.c @@ -7,8 +7,6 @@ int main(int argc, char* argv[]){ getUserConfig(argc, argv); getPage(); - printPage(); - Token* token = NULL; do { token = nexttoken();