Compare commits

..

2 commits

Author SHA1 Message Date
f6fe9a2982
Change nsh to vip 2024-11-12 12:26:51 +00:00
0ce56aff2e
Update Makefile 2024-11-12 11:48:32 +00:00
2 changed files with 3 additions and 4 deletions

View file

@ -4,7 +4,6 @@
VERSION = 1.0 VERSION = 1.0
TARGET = ccc TARGET = ccc
MANPAGE = $(TARGET).1 MANPAGE = $(TARGET).1
CONF = config.h
PREFIX ?= /usr/local PREFIX ?= /usr/local
BINDIR = $(PREFIX)/bin BINDIR = $(PREFIX)/bin
MANDIR = $(PREFIX)/share/man/man1 MANDIR = $(PREFIX)/share/man/man1
@ -15,7 +14,7 @@ CFLAGS = -Os -march=native -mtune=native -pipe -s -flto -std=c99 -pedantic -Wall
SRC = ccc.c util.c file.c icons.c SRC = ccc.c util.c file.c icons.c
$(TARGET): $(SRC) $(CONF) $(TARGET): $(SRC) config.h
$(CC) $(SRC) -o $@ $(CFLAGS) $(LDFLAGS) $(CC) $(SRC) -o $@ $(CFLAGS) $(LDFLAGS)
dist: dist:

4
ccc.c
View file

@ -911,12 +911,12 @@ void show_file_content(void)
dup2(pipe_fd[1], STDOUT_FILENO); dup2(pipe_fd[1], STDOUT_FILENO);
dup2(pipe_fd[1], STDERR_FILENO); dup2(pipe_fd[1], STDERR_FILENO);
close(pipe_fd[1]); close(pipe_fd[1]);
execlp("nsh", "nsh", current_file.name, NULL); execlp("vip", "vip", "-c", current_file.name, NULL);
} }
_exit(1); _exit(1);
} else if (pid > 0) { } else if (pid > 0) {
/* Parent */ /* Parent */
if (strstr(current_file.name, ".jpg") == NULL && strstr(current_file.name, ".png") == NULL) { if (!strstr(current_file.name, ".jpg") && !strstr(current_file.name, ".png")) {
close(pipe_fd[1]); close(pipe_fd[1]);
char buffer[4096]; char buffer[4096];
int row = 1; int row = 1;