Audit nl(1)

1) Refactor the manpage to use the num-syntax and concise wording.
2) Build format instead of having a list of static strings.
3) BUGFIX: if (!buf[0] || buf[0] == '\n') Process last-read-line
           properly.
4) BUGFIX: In case we hit a formatting line, print a newline instead
           of just dropping it.
5) Use a switch instead of having spaghetti-cases.
6) Don't use printf-magic but explicitly do a putchar(' ')-loop.
7) Update usage(), indent properly.
8) BUGFIX: strchr is not NULL when type[0] is \0. Check for \0
           separately beforehand.
9) Reorder arg.h-cases for better readability.
This commit is contained in:
FRIGN
2015-03-22 16:29:50 +01:00
parent d49f6f2044
commit 587575dcb4
3 changed files with 107 additions and 101 deletions

2
README
View File

@@ -49,7 +49,7 @@ The following tools are implemented ('*' == finished, '#' == UTF-8 support,
=*| mktemp non-posix none
=*| mv yes none (-i)
=*| nice yes none
#* nl yes none
#*| nl yes none
=*| nohup yes none
#*| paste yes none
=*| printenv non-posix none