diff --git a/Makefile b/Makefile index 397da40..75eb580 100644 --- a/Makefile +++ b/Makefile @@ -1,7 +1,7 @@ prefix=/usr/local all: - cc -Wall -Wextra -pedantic -o _z_prompt_command z_prompt_command.c + cc -Wall -Wextra -pedantic -std=c99 -D_GNU_SOURCE -o _z_prompt_command z_prompt_command.c install: _z_prompt_command install -m 0755 _z_prompt_command $(prefix)/bin diff --git a/z_prompt_command.c b/z_prompt_command.c index 6749b1d..39f919d 100644 --- a/z_prompt_command.c +++ b/z_prompt_command.c @@ -1,6 +1,6 @@ // PROMPT_COMMAND for z.sh -#include +#include #include #include #include @@ -8,7 +8,7 @@ #include #include -int main(int __unused argc, char **argv) { +int main(int argc __attribute__((unused)), char **argv) { if (argv[1] == NULL) return EXIT_FAILURE; @@ -22,7 +22,7 @@ int main(int __unused argc, char **argv) { FILE *read; FILE *write; FILE *aged; - char line[LINE_MAX]; + char line[PATH_MAX * 2]; char pth[PATH_MAX]; float rank; int timestamp;