Compare commits
2 commits
3fe500d761
...
f6fe9a2982
Author | SHA1 | Date | |
---|---|---|---|
f6fe9a2982 | |||
0ce56aff2e |
2 changed files with 3 additions and 4 deletions
3
Makefile
3
Makefile
|
@ -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
4
ccc.c
|
@ -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;
|
||||||
|
|
Loading…
Reference in a new issue