aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authors-over-42023-06-12 21:06:08 -0400
committers-over-42023-06-12 21:06:08 -0400
commit363742d74864f0883fd8ee081f6ab2ba3ea71ac0 (patch)
treea847c345daf8402db6464a59d0cb6d9c37602137
parentcc1ddbdc819653d6c54cfef818e7ecd4e732797b (diff)
make
-rw-r--r--Makefile6
-rw-r--r--src/lexer.c1
2 files changed, 4 insertions, 3 deletions
diff --git a/Makefile b/Makefile
index ba0f1de..df0a9bb 100644
--- a/Makefile
+++ b/Makefile
@@ -13,10 +13,10 @@ $(name): $(objects)
install:
make
- cp ./$(name) $(XDG_DATA_HOME)/bin/$(name)
+ [ $(XDG_DATA_HOME) ] && cp ./$(name) $(XDG_DATA_HOME)/bin/$(name) || cp ./$(name) /usr/local/bin/$(name)
uninstall:
- rm -f $(XDG_DATA_HOME)/bin/$(name)
+ [ $(XDG_DATA_HOME) ] && rm -f $(XDG_DATA_HOME)/bin/$(name) || rm -f /usr/local/bin/$(name)
clean:
rm -f ./$(name) ./src/*.o
@@ -26,3 +26,5 @@ me:
a sandwich:
@exit
+
+.PHONY: install uninstall clean me a sandwich
diff --git a/src/lexer.c b/src/lexer.c
index 5a0a6e9..838a907 100644
--- a/src/lexer.c
+++ b/src/lexer.c
@@ -171,7 +171,6 @@ token_t* lexer_collect(lexer_t* lexer, char end_char, int fskip, int lskip, int
while (lexer->c != end_char) {
char* current = lexer_get_c_as_string(lexer);
- // printf("[%p, %ld]\n", token, (strlen(token) + strlen(current) * sizeof(char)));
token = realloc(
token,
(len + strlen(current) * sizeof(char))