changes to C stuff for gcc/linux

This commit is contained in:
rupa committed 2013-12-26 12:43:20 -05:00
1 parent 2a8351195e
commit cb7d092422
2 files changed
+4 -4

No files matched your search

+1 -1
View File
@@ -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
+3 -3
View File
@@ -1,6 +1,6 @@
// PROMPT_COMMAND for z.sh
#include <limits.h>
#include <linux/limits.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
@@ -8,7 +8,7 @@
#include <time.h>
#include <unistd.h>
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;