Commit Graph

1300 Commits

Author SHA1 Message Date
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
Roberto E. Vargas Caballero
19fb7f115d Add -lrt switch
find(1) uses clock_gettime which in some systems needs -lrt.
2015-02-20 13:46:49 +00:00
Hiltjo Posthuma
bb79b5c7eb uudecode: fix no newline before EOF 2015-02-20 14:36:50 +01:00
Hiltjo Posthuma
ddeb4c0e35 uudecode: add newline to out-of-range error 2015-02-20 14:36:50 +01:00
FRIGN
b47dab2d4d Don't be too pedantic in expr.c 2015-02-20 13:45:57 +01:00
Hiltjo Posthuma
31f0624f3d code-style: minor cleanup and nitpicking 2015-02-20 13:29:38 +01:00
Hiltjo Posthuma
6c7ff5fda5 code-style: unindent one level of switch 2015-02-20 13:29:38 +01:00
Hiltjo Posthuma
5a6715c0cf unexpand: spaces to tabs 2015-02-20 13:29:38 +01:00
sin
36dc38acf6 Add missing limits.h include for nl(1)
Required for the *_MAX constants.
2015-02-20 12:21:46 +00:00
sin
9de3546082 Implement nl -w width 2015-02-20 12:15:43 +00:00
sin
13e4231f4c Implement nl -v startnum 2015-02-20 12:05:54 +00:00
sin
028b0c206f Fix style
This broke sbase-box because it assumes that main(...) starts on
a separate line.
2015-02-20 10:24:11 +00:00
Evan Gates
76e6aacd60 Add initial find(1) implementation
No manpage yet.
2015-02-20 10:17:16 +00:00
Quentin Rameau
51b707e91e ls: add support for -p 2015-02-19 18:52:13 +00:00