1
0

sysexits(1) working

This commit is contained in:
dtb 2022-06-04 20:26:12 -04:00
parent e564d62bf6
commit adafc55a05
2 changed files with 5 additions and 3 deletions

View File

@ -3,6 +3,8 @@ CC=cc
CFLAGS=-I include/ -I lib/ -Wall
RM=rm -f
working: id
all: libraries programs
cleanall: clean cleanlibraries cleanprograms

View File

@ -119,14 +119,13 @@ static int findbyint(int status){
for(i = 0; i < ARRAYLEN(sysexits); ++i)
if(sysexits[i].status == status)
return i;
return -1;
}
static void output_comment(int fd, int indentation, int width, char *comment){
size_t word_start;
size_t line_start;
return;
for(i = 0, line_start = 0, word_start = 0; ; ++i)
switch(comment[i]){
case '\0':
@ -154,7 +153,7 @@ static void output_comment(int fd, int indentation, int width, char *comment){
static void output_header(void){
write(1, header_prefix, ARRAYLEN(header_prefix) - 1);
for(i = 0; i < ARRAYLEN(sysexits); ++i){
output_comment(1, 1 * TAB_WIDTH, 80, sysexits[i].desc);
//output_comment(1, 1 * TAB_WIDTH, 80, sysexits[i].desc);
#ifdef ENUM
fprintf(stdout, "\t%s = %d%s",
sysexits[i].name,
@ -169,6 +168,7 @@ static void output_header(void){
);
#endif /* ifdef DEFINE */
}
fflush(stdout); /* Fixes actual issue. */
write(1, header_suffix, ARRAYLEN(header_suffix) - 1);
}