Commit Graph

482 Commits

Author SHA1 Message Date
sin
b8edf3b4ee Add weprintf() and replace fprintf(stderr, ...) calls
There is still some programs left to be updated for this.

Many of these programs would stop on the first file that they
could not open.
2013-11-13 11:41:43 +00:00
sin
34f7a688cb Add barebones mktemp(1) 2013-11-13 11:06:55 +00:00
sin
80c5ab46ba Fix style for function definitions 2013-11-12 13:37:38 +00:00
sin
8f931fba13 Remove passwd from TODO
This cannot be made portably so we'll implement this in ubase.
2013-11-12 13:12:42 +00:00
sin
8fdfa7caeb Convert cksum(1) to use FILE * instead of an fd
In sbase we generally do I/O through FILE * instead of file
descriptors directly.

Do not error out on the first file that can't be opened.
2013-11-12 11:17:08 +00:00
sin
cfe5e9ef3a Support tail-ing multiple files 2013-11-12 10:47:22 +00:00
sin
d9abff1e84 Don't exit on the first file that can't be opened for head and fold 2013-11-12 10:46:53 +00:00
sin
7add068ade Rename brk' to _brk' to avoid polluting the namespace 2013-11-12 10:18:18 +00:00
dsp
3f9e501f6b Add ARGNUM and ARGNUMF(base)
This is useful to support the obsolete syntax -NUM for tools like
head, tail and fold.
2013-11-12 10:17:52 +00:00
sin
2046778bc9 Update manpage for binary operations in test(1) 2013-11-11 12:01:47 +00:00
sin
18fbd4606c Return false in case we invoke `test s1' and s1 is the null string 2013-11-11 12:00:22 +00:00
sin
c23616555b Add support for -k (checking sticky bit) to test(1) 2013-11-11 11:56:32 +00:00
sin
11c078d116 Fix styling issue in test(1) 2013-11-11 11:54:04 +00:00
sin
af1fb0c9c2 Inverse condition to avoid nesting in test(1) 2013-11-11 11:48:54 +00:00
sin
c55948ba91 No need to use USED() in arg.h for sbase
Tested on Linux and OpenBSD (with gcc and pcc).
2013-11-07 10:06:12 +00:00
sin
777f958426 Update TODO
We are not going to support logname(1).
2013-10-29 17:20:13 +00:00
sin
06d43e4832 Fix relocation error on OpenBSD (amd64) when compiling with pcc
ld: util.a(eprintf.o): relocation R_X86_64_32S can not be used when making a shared object; recompile with -fPIC
util.a: could not read symbols: Bad value
*** Error 1 in . (Makefile:114 'basename': @pcc -o basename basename.o util.a -g)
*** Error 1 in /home/sin/repos/sbase (Makefile:104 'binlib')
2013-10-28 10:45:11 +00:00
sin
b2a0362bf8 Use estrtol() instead of atoi() 2013-10-27 09:49:08 +00:00
Markus Wichmann
298703ff2d Add sticky bit to documentation. 2013-10-20 10:41:32 +01:00
Markus Wichmann
a55cc8c95e Make chmod and ls recognize sticky bit (S_ISVTX). 2013-10-20 10:41:32 +01:00
Markus Wichmann
35053c1d48 Make chmod honor S_ISVTX. 2013-10-20 10:41:31 +01:00
Markus Wichmann
a4eb639ba7 Make mkdir read mode argument as octal. 2013-10-20 10:41:31 +01:00
sin
0690c1a003 Always round up to the next blocksize unit in du(1) 2013-10-18 16:42:00 +01:00
sin
6a680269bf Add more commands to TODO 2013-10-18 15:19:04 +01:00
sin
fc9c4d9123 Update TODO based on people's suggestions 2013-10-18 10:02:23 +01:00
sin
a6e5696cbd Fix indentation in du(1) 2013-10-17 18:11:20 +01:00
sin
9e321b69d2 No need for realpath() to call malloc() in du(1)
Print links correctly as well.
2013-10-17 14:15:06 +01:00
sin
ac130cbbe0 Update usage line and manpage for du(1)
Do not allow -a and -s to be specified at the same time.
2013-10-17 11:27:42 +01:00
sin
ac3a5e0091 Add -k support for du(1)
This setting overrides the BLOCKSIZE environment variable.
2013-10-16 19:22:55 +01:00
sin
6e8b79ebd8 Add -s support for du(1) 2013-10-16 19:22:46 +01:00
sin
09fcbfc338 Add primitive du(1)
Defaults to a 512-byte blocksize.
2013-10-16 18:18:02 +01:00
sin
84ba9cb87e Remove cut from TODO 2013-10-16 14:14:18 +01:00
sin
8617b29355 Implement the basic binary operations for test(1) 2013-10-15 15:38:32 +01:00
sin
d8718d4159 Do not interpret -[rwxs] as options in chmod(1)
To chmod recursively use `-R' as opposed to `-r' so we can
distinguish it from the mode `-r'.
2013-10-11 17:02:58 +01:00
sin
6492c59072 Free allocated memory
No harm but silences analyzers and we are already
free-ing buffers everywhere else.
2013-10-11 17:02:58 +01:00
sin
486d22fc48 Simplify code in cut(1)
Thanks Roberto and Rob for your input on this.
2013-10-10 23:04:46 +01:00
sin
f559b71488 Free allocated buffer 2013-10-10 20:37:31 +01:00
sin
12ad81fa24 Allow strings(1) to operate on more than one file 2013-10-10 16:05:05 +01:00
sin
484d5b4340 Do not rely on `s' being incremented before taking the address of it
The order of evaluation for the arguments of a function is not
defined by the standard.
2013-10-09 16:42:45 +01:00
sin
cabbf6141e Allow sbase-box to be called as sbase-box tool args... 2013-10-08 23:32:29 +01:00
Truls Becken
576a5ce55e Add cut(1) 2013-10-08 20:41:32 +01:00
sin
9eb15ff232 Simplify code and don't use ftw() for chgrp(1)
Fix issue with uninitialized struct stat buffer as well.
2013-10-08 00:47:04 +01:00
sin
8cd24f0525 Revert "Make sbase compile with musl"
musl-0.9.14 defines PRIO_MIN and PRIO_MAX
2013-10-07 20:47:33 +01:00
sin
f349dd5987 Use arg.h as much as possible and add usage() where missing
Rename eusage() to usage() as well.
2013-10-07 17:13:01 +01:00
sin
5b5f062184 Add license file details at top of files 2013-10-07 17:03:34 +01:00
sin
b5a511dacf Exit with EXIT_SUCCESS/EXIT_FAILURE instead of 0 and 1
Fixed for consistency purposes.
2013-10-07 16:44:22 +01:00
sin
ac033652fe Do not return 0 on error for setsid(1) 2013-10-07 16:44:14 +01:00
sin
bf17657544 Remove chvt(1) from sbase as it is not portable
chvt(1) has been moved to ubase.
2013-10-07 16:43:48 +01:00
sin
eafe2b6526 Staticise global variables in chgrp(1) 2013-10-07 16:12:09 +01:00
sin
7182076473 Add a usage() function like everywhere else 2013-10-07 16:09:14 +01:00