Commit Graph

1563 Commits

Author SHA1 Message Date
FRIGN
f20075b0bc Mark yes(1) as audited in README 2015-02-28 21:12:27 +01:00
FRIGN
ad9a9dd3e1 Audit yes(1)
Oh well, time to simplify the loop.
Also, change the comment on unreachable code to something more clear.
2015-02-28 21:11:10 +01:00
FRIGN
bf3210b6de Audit echo(1)
Just a small change in the manpage.
2015-02-28 20:16:10 +01:00
FRIGN
e00fe1f9bf Audit sleep(1)
1) Be strict about argc
2) Use "unsigned" instead of "unsigned int"
2015-02-28 20:10:25 +01:00
FRIGN
39b9aab25a Audit unlink(1)
One small thing, use argv0 in usage.
Also, add a blank line in link.c which I forgot earlier.
2015-02-28 20:05:22 +01:00
FRIGN
b9b28d4039 Audit tty(1)
1) Be strict about number of arguments passed
2) Use a simpler logic while returning
2015-02-28 19:59:34 +01:00
FRIGN
e45297a320 Audit dirname(1)
Be stricter about the number of arguments passed to it.
2015-02-28 19:51:07 +01:00
FRIGN
cb610b2c7b Audit link(1) 2015-02-28 19:42:56 +01:00
sin
804b62f7a2 Fix broken sbase-box due to multiple definitions of usage 2015-02-28 18:33:33 +00:00
Hiltjo Posthuma
3068ea2318 README: document sbase-box-install rule 2015-02-28 15:40:16 +01:00
sin
7ee3569327 Update README for time(1) 2015-02-28 14:42:11 +00:00
sin
d083a94731 time: errno is not guaranteed to be set for sysconf()
0 should be considered an invalid CLK_TCK.
2015-02-28 14:36:50 +00:00
FRIGN
65ae4afa7c Mark false(1) and true(1) as audited
Nothing to be done there.
2015-02-28 15:12:19 +01:00
FRIGN
5be621dcf2 Refactor basename.1 2015-02-28 15:09:47 +01:00
FRIGN
e7c33c4af3 Audit basename(1)
1) be stricter which number of arguments is accepted (1 or 2)
2) basename already returns a pointer to "." is argv[0] is ""
3) No need to check for *p != '/', because basename() only returns
   a string beginning with '/' which has length 1, so if strlen(p)
   == 1, the only way for suffix to be "evaluated" is for off to
   be > 0, being equal to suffix being "", but "" != "/".
4) don't calculate strlen twice for each string. Store it in a
   ssize_t and check if it's > 0.
2015-02-28 14:48:44 +01:00
FRIGN
44bd931834 Add audit-section to README
Okay, so why another section?
The finished-section applies to general feature-completeness and
manual status. It somehow is not an indicator for general code-
clarity, so the audited-column reflects a thorough audit of the
underlying code and optimization.
Take a look at the upcoming basename(1)-patch for an example on
how this goes.
2015-02-28 14:42:26 +01:00
Hiltjo Posthuma
bcd649da55 add find.1, sed.1, time.1 stubs
all tools should have man pages. add stubs so make install and
make sbase-box-install doesn't fail.
2015-02-28 13:46:20 +01:00
Hiltjo Posthuma
318ed94f63 chown.1, strings.1: fix date 2015-02-28 13:43:29 +01:00
Hiltjo Posthuma
4a4d0825b1 make rule: sbase-box-install
rule to make sbase-box and setup symlinks for $BIN and /bin/[

some (maybe) interesting info:

$ make LDFLAGS="-s -static" CFLAGS="-Os" PREFIX=/ DESTDIR=`pwd`/static-normal install
$ make LDFLAGS="-s -static" CFLAGS="-Os" PREFIX=/ DESTDIR=`pwd`/static-box sbase-box-install

$ du -sk static-normal/ static-box
2728    static-normal/
572     static-box
2015-02-28 13:30:06 +01:00
sin
84e7fbda24 time(1) cleanup 2015-02-27 21:43:11 +00:00
Evan Gates
5c8d5c1dca add time. do not mark complete/POSIX compliant as exit status is wrong. 2015-02-27 21:39:50 +00:00
FRIGN
7cc4ef0734 Don't break the coding-style 2015-02-26 19:07:02 +01:00
Evan Gates
bf4c5d1fcd expr comments, cleanup, UTF-8 support 2015-02-26 17:26:47 +00:00
FRIGN
1cdb424ac6 Remove tabs(1) from TODO
It needs to be in ubase due to terminfo.
Thanks Roberto!
2015-02-26 10:36:55 +01:00
sin
71f49d7c04 tput should be in ubase 2015-02-25 22:03:56 +00:00
Evan Gates
fb89ed012b re-typedef Test, use NOTREACHED comment instead of comma operator, both as per style guide 2015-02-25 21:08:35 +00:00
Evan Gates
3eed1fced6 a bunch of cleanup 2015-02-25 10:11:55 +00:00
Evan Gates
e427364a28 use struct literal instead of filling each field manually 2015-02-25 10:11:47 +00:00
Evan Gates
4671b4c974 no need for array of function pointers for comparisons, just use the necessary function pointer itself 2015-02-25 10:11:35 +00:00
Evan Gates
49d80b46bb add space for END token 2015-02-24 10:23:18 +00:00
Evan Gates
91bb8ed7d6 remove extra get_n_arg declarations (copy pasta) 2015-02-24 10:23:17 +00:00
FRIGN
1def981831 Add mkrunetype.awk
and add a Makefile in libutf/ to allow auto-generation
2015-02-23 20:36:47 +01:00
noname
274f9eaf42 Replace strlen with unary_n to test zero length. 2015-02-22 19:40:28 +00:00
Quentin Rameau
7264acf7ed ls: add -n option 2015-02-22 12:30:47 +00:00
sin
9e37634571 ls: Clarify that -1 is set implicitly when -R is used 2015-02-21 11:47:37 +00:00
Tai Chi Minh Ralph Eastwood
0eaff8b7fe Update README for ls -R 2015-02-21 11:46:04 +00:00
Tai Chi Minh Ralph Eastwood
dacd523ec1 ls: add support for -R flag 2015-02-21 11:46:04 +00:00
sin
9c30fbf018 Add ls -A implementation
Thanks joshua@cubesolving.com!
2015-02-21 09:31:01 +00:00
Evan Gates
6abce61877 insert implicit -a after primary before ! 2015-02-21 09:25:05 +00:00
Evan Gates
639a74a537 find: Change execv to execvp
- Make globals static
- Fix a comment
- Change some data types
- Rearrange struct members from largest to smallest
  (no affect due to small structs, good practice)
2015-02-21 09:24:31 +00:00
Evan Gates
9048b542c7 align redirections in Makefile for readability 2015-02-21 09:22:27 +00:00
Evan Gates
b7c2bbc6db replace printf + putchar with fputs 2015-02-21 09:22:25 +00:00
Evan Gates
a2e704c8c9 use parameter expansion instead of basename in Makefile 2015-02-21 09:22:21 +00:00
Evan Gates
654997c320 add [ alias for test 2015-02-21 09:22:16 +00:00
Evan Gates
3751dd546f no need for libutf in test, a null byte is a null byte 2015-02-20 19:29:28 +00:00
sin
84924d050e Add info about NetBSD to config.mk 2015-02-20 16:24:17 +00:00
sin
71de7813c0 Include strings.h for strcasecmp()
Fixes another build error on NetBSD.
2015-02-20 16:00:58 +00:00
sin
b08bb6aad6 Use st_mtime as opposed to st_mtim.tv_sec
This is more portable and fixes a build issue on NetBSD.  We ignore
nanoseconds in this case so there's no functional difference.
2015-02-20 15:47:50 +00:00
sin
cd51795423 Implement nl -n format 2015-02-20 14:12:48 +00:00
Roberto E. Vargas Caballero
b8fbaa9b0d Remove bit fields
Before removing bit fields:

$ size find

   text	   data	    bss	    dec	    hex	filename

  16751	    968	     48	  17767	   4567	find

After removing bit fields:
$ size find
   text    data     bss     dec     hex filename
  16527     968      68   17563    449b find

This is an example where bit fields uses more memory
than integers or char. There is going to be only one
gflags struct, so the waste in instructions is bigger
than the space saved by bit fields. In the case of Permarg,
Sizearg, Execarg there is only one bit field, so at least
one unsigned is used, so there is no any gain.
2015-02-20 13:46:56 +00:00