Commit Graph

687 Commits

Author SHA1 Message Date
FRIGN
85df198b59 Refactor expr.c
Finish up what has been begun.
2014-11-17 15:05:49 +00:00
sin
166bc3052e Use PRIO_{MIN,MAX} instead of NZERO
Some systems do not define NZERO.  NZERO seems to be an XSI extension
and PRIO_{MIN,MAX} is not specified by POSIX but most relevant systems
define it.
2014-11-17 15:02:51 +00:00
sin
bd3cf55b54 Define HOST_NAME_MAX if necessary
Some systems do not provide this, namely FreeBSD and NetBSD.
2014-11-17 14:50:40 +00:00
sin
ba70777b56 Remove binlib and bin from PHONY 2014-11-17 14:46:52 +00:00
sin
74ac827587 Require GNU make to build sbase
We seem to have problems building individual tools across various
make implementations.  If anyone can step up and fix this we will
remove the dependency on GNU make.
2014-11-17 13:54:24 +00:00
sin
90507652c0 Staticise globals 2014-11-17 13:39:11 +00:00
sin
a84cbe9e1c Avoid messed up output because of trailing spaces 2014-11-17 13:22:54 +00:00
sin
ba89dc565f Add .PHONY targets 2014-11-17 13:02:32 +00:00
sin
a6be4e7a4c Only unlink the destination file if -f has been specified 2014-11-17 12:33:08 +00:00
sin
0d0624b855 Use $(RANLIB) in Makefile 2014-11-17 12:24:03 +00:00
sin
2ee3ae5994 Use LIB, LIBSRC and LIBOBJ and derive SRC, OBJ and MAN from BIN 2014-11-17 12:14:25 +00:00
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