Commit Graph

1626 Commits

Author SHA1 Message Date
sin
afa2e6ec54 Use SLIST_* instead of TAILQ_* in grep(1)
The order of evaluation is unspecified by POSIX so we do not need
to process the patterns in-order.
2014-11-17 10:59:51 +00:00
sin
de4a36957e Silence stupid warnings when building sbase-box 2014-11-17 10:52:24 +00:00
sin
4a97e0b526 List libutil.a first to be a bit more clear 2014-11-17 10:50:45 +00:00
sin
1b0d2c1ab3 Make clean more verbose 2014-11-17 10:39:02 +00:00
sin
e1c044e298 Do not append CPPFLAGS to CFLAGS 2014-11-17 10:38:37 +00:00
sin
2fd6e769dd Rename util.a to libutil.a 2014-11-17 10:37:07 +00:00
sin
9a9d6bb0dc Make build process more verbose 2014-11-17 10:36:39 +00:00
FRIGN
abdd0671f7 Refactor expr.c 2014-11-17 10:05:19 +00:00
Hiltjo Posthuma
f6552e3669 grep: add -h (inverse of -H) aswell 2014-11-17 10:05:10 +00:00
sin
7b8d7fb78e Fix uninitialized use of ret in expr(1) 2014-11-16 14:52:44 +00:00
Hiltjo Posthuma
b3ae1a7b4b expr: improvements
- handle divide by zero.
- use eregcomp().
- use emalloc().
- use snprintf() for safety and add a buffer size argument to valstr() just
  to be sure.
- code-style fixes.
2014-11-16 14:37:22 +00:00
Hiltjo Posthuma
1822f70d12 csplit, grep: use eregcomp 2014-11-16 14:37:10 +00:00
Hiltjo Posthuma
3fb0e50668 nl: fix crash on invalid regex 2014-11-16 14:36:59 +00:00
Hiltjo Posthuma
ce90cc57d4 util: add eregcomp: show descriptive error message on regcomp error 2014-11-16 14:36:41 +00:00
sin
25e3e068ed Add note about UTF-8 support in TODO 2014-11-16 13:25:08 +00:00
sin
7759ba07df Fix error message 2014-11-16 13:20:36 +00:00
sin
0dcf33a1df Style fix 2014-11-16 13:17:06 +00:00
sin
b200a6e75f Set exit status accordingly in printenv(1) 2014-11-16 13:14:13 +00:00
sin
3fa0a358b1 Fix completely broken printenv(1) 2014-11-16 13:11:35 +00:00
sin
25a375b707 Update TODO 2014-11-16 12:59:34 +00:00
sin
da715252b3 Add license heading at the top in expr.c 2014-11-16 12:57:54 +00:00
sin
15097f6ab3 Don't use C++ type comments 2014-11-16 12:54:47 +00:00
Evan Gates
6240d26beb new expr using shunting-yard instead of recursive descent (this time with tabs) 2014-11-16 12:52:48 +00:00
sin
67fcc79046 Use queue.h in grep(1) 2014-11-16 12:39:15 +00:00
Hiltjo Posthuma
865869fb28 grep: add -H flag 2014-11-16 11:23:18 +00:00
FRIGN
e17b9cdd0a Convert codebase to use emalloc.c utility-functions
This also definitely increases readability and makes OOM-conditions
more consistent.
2014-11-16 10:22:39 +00:00
sin
045fc62028 Group related decls together in util.h 2014-11-14 18:13:26 +00:00
sin
2982d88533 Import ealloc.c from ubase 2014-11-14 18:10:05 +00:00
sin
35d467d971 Add make to TODO 2014-11-14 17:59:51 +00:00
sin
3de142ba70 Delete dist when cleaning 2014-11-14 14:41:05 +00:00
sin
300eedc50a Add README and TODO to dist target 2014-11-14 11:58:42 +00:00
FRIGN
7fc5856e64 Tweak NULL-pointer checks
Use !p and p when comparing pointers as opposed to explicit
checks against NULL.  This is generally easier to read.
2014-11-14 10:54:30 +00:00
FRIGN
ec8246bbc6 Un-boolify sbase
It actually makes the binaries smaller, the code easier to read
(gems like "val == true", "val == false" are gone) and actually
predictable in the sense of that we actually know what we're
working with (one bitwise operator was quite adventurous and
should now be fixed).

This is also more consistent with the other suckless projects
around which don't use boolean types.
2014-11-14 10:54:20 +00:00
FRIGN
7d2683ddf2 Sort includes and more cleanup and fixes in util/ 2014-11-14 10:54:10 +00:00
Evan Gates
0810c61154 add -D_DEFAULT_SOURCE to placate gcc 2014-11-14 10:37:52 +00:00
sin
ee55fbe9e9 Just make $(HDR) a prereq for $(OBJ)
The result is always correct but it might do redundant builds.
Not really an issue as sbase builds very fast.  The alternative is
to track the header deps manually but this is already incomplete and
unlikely to be kept up to date.
2014-11-13 18:28:18 +00:00
sin
2c7516c716 Sort HDR in Makefile 2014-11-13 18:21:19 +00:00
FRIGN
eee98ed3a4 Fix coding style
It was about damn time. Consistency is very important in such a
big codebase.
2014-11-13 18:08:43 +00:00
sin
e35d9e62a5 Just use HOST_NAME_MAX in hostname(1)
Using sysconf() + malloc() is overkill.
2014-11-13 17:22:02 +00:00
sin
44b3ea8f76 Use _exit() instead of return if exec* fails 2014-11-13 17:06:41 +00:00
sin
2869adf458 Update TODO 2014-11-13 16:33:47 +00:00
sin
519a4f8105 Don't overwrite the line buffer when we hit EOF on one of the files in comm(1) 2014-11-13 16:01:53 +00:00
sin
d208659414 Add "-" support to comm(1) 2014-11-13 16:01:44 +00:00
sin
49c91462b3 Undef MIN/MAX in case they are defined somewhere else 2014-11-13 16:01:34 +00:00
sin
7ffe164106 Modify argv[0] in place 2014-11-13 16:01:22 +00:00
sin
6449db8691 Make both arguments to cmp(1) mandatory and handle "-" properly 2014-11-13 16:01:10 +00:00
sin
dfd0e6e77d Add a conformance table in the README
We should investigate the current state of the tools one by one
and mark out those that are complete and POSIX conformant.
2014-11-13 14:59:41 +00:00
sin
9f6dd58538 Remove unneeded statement 2014-11-13 14:56:43 +00:00
sin
f9a7a7e59f Fix argument naming in dirname(1) 2014-11-13 14:56:34 +00:00
sin
a7ad11ed5e Fix overflow in basename(1) 2014-11-13 14:56:25 +00:00