Commit Graph

720 Commits

Author SHA1 Message Date
sin
69cde23703 Proper copyright header for strlcpy and strlcat 2014-05-28 11:15:59 +01:00
sin
4896bdf6de Revert "Make grep more memory-efficient"
This reverts commit d9a098ae6bc07188cbaefcd188e5911dec41815d.

Conflicts:
	grep.c

Hiltjo Posthuma <hiltjo@codemadness.org> said:

(Re)compiling the regex for each line doesn't make sense (imho) and
slows it down a lot.

A simple test:

time seq 1 100000000 | grep 'a'

sbase grep (before patch):
    0m22.21s real     0m0.00s user     0m0.00s system

sbase grep (after patch):
    2m16.28s real     0m0.00s user     0m0.00s system

coreutils grep:
    0m1.15s real     0m0.00s user     0m0.00s system

So the patch should be reverted I think.
2014-05-12 12:06:40 +01:00
Hiltjo Posthuma
5b3a0a9382 build warnings: initialise values...
... to make fix gcc warnings with -Wall.

Signed-off-by: Hiltjo Posthuma <hiltjo@codemadness.org>
2014-05-12 12:06:14 +01:00
sin
11eef783fe Declare error buffer at start of block 2014-05-12 00:40:29 +01:00
FRIGN
fb1bfe24bb Make grep more memory-efficient 2014-05-12 00:32:50 +01:00
FRIGN
8ea17b2a7d Switching to real name 2014-05-11 11:04:26 +01:00
Jakob Kramer
9366f48b1f sort: simplify linecmp, rename curr => tail 2014-05-06 18:01:44 +01:00
Jakob Kramer
8a44c352ee renice(1): renice is not PASTE 2014-05-06 16:21:56 +01:00
Jakob Kramer
6f7e9a5078 sort: add support for "per-keydef" flags 2014-05-06 16:21:50 +01:00
Jakob Kramer
109e8963f5 sort: ignore trailing newline while sorting 2014-05-06 16:21:45 +01:00
Jakob Kramer
0723c8d32e sort: work with signed integers as well 2014-05-06 16:21:39 +01:00
sin
9694305e05 Chop one level of indentation
eprintf() will exit the program, no need to use the else construct.
2014-05-05 15:12:20 +01:00
sin
b257f7a05f cp: Don't try to open the file twice in case we did not provide -f 2014-05-05 15:06:23 +01:00
sin
02918a46e8 Implement cp -f 2014-05-05 15:02:03 +01:00
Daniel Bainton
c323f6f233 Support reading checksums from stdin 2014-05-05 10:05:48 +01:00
Daniel Bainton
9ad5ca5a15 Add breaks to the sha*sum arg cases 2014-05-05 10:05:43 +01:00
Jakob Kramer
814b04e710 sort: document -b 2014-05-04 00:16:24 +01:00
Jakob Kramer
a2da9edb99 sort: simplify skip_columns 2014-05-04 00:15:57 +01:00
Jakob Kramer
d965985a52 sort: add -b flag; don't use it as default 2014-05-04 00:15:46 +01:00
Jakob Kramer
a62a2197a8 sort: don't evaluate if clause
this fixes that you could specify a key
definition like "-k 1.2.3", which is incorrect.
2014-05-04 00:15:33 +01:00
Jakob Kramer
e535e8d88a sort: replace loop with MIN() 2014-05-04 00:15:23 +01:00
Jakob Kramer
56e1616486 sort: remove 'rest' variable 2014-05-04 00:15:10 +01:00
Jakob Kramer
56b9a26de9 sort: don't repeat skipping columns logic 2014-05-04 00:14:58 +01:00
Jakob Kramer
c4e5354a32 sort: linebuf is no global 2014-05-04 00:14:19 +01:00
sin
f23409f65a Break long line in mktemp(1) 2014-05-02 21:38:40 +01:00
Jakob Kramer
0bc6b1377b sort: readability; check strndup return value 2014-04-30 15:17:01 +01:00
sin
f8a216a18c Add -D_GNU_SOURCE to config.mk for tcc 2014-04-29 22:31:16 +01:00
Silvan Jegen
60e972c229 Update tr.1 man page
Document the -d option and slightly change the wording of the page.

Signed-off-by: Silvan Jegen <s.jegen@gmail.com>
2014-04-27 11:42:10 +01:00
Hiltjo Posthuma
997f4f006c chown: return EXIT_FAILURE if one file failed.
NOTE: coreutils chown wont process file series further on error, but busybox does. For consistency among the other tools follow busybox behaviour.

Signed-off-by: Hiltjo Posthuma <hiltjo@codemadness.org>
2014-04-24 11:51:54 +01:00
Hiltjo Posthuma
90861840b7 chmod: process file series behaviour
continue processing files if a chmod on a file in a series failed, but return with an error status code.

Signed-off-by: Hiltjo Posthuma <hiltjo@codemadness.org>
2014-04-24 11:51:43 +01:00
Hiltjo Posthuma
bd99b92e91 parsemode: rework
- for octal input: reset mode to 0.
- take umask into account.
- make '=rwx' etc work.
- we wont support crazy but valid modes like "a+rw,g=x,o=g"
- uudecode: use parsemode, mask is 0.

Signed-off-by: Hiltjo Posthuma <hiltjo@codemadness.org>
2014-04-24 11:51:33 +01:00
Hiltjo Posthuma
a1b62b2282 sort: style, explicitly state type
Signed-off-by: Hiltjo Posthuma <hiltjo@codemadness.org>
2014-04-23 15:25:21 +01:00
dwts
459161481a use always static for usage and keep usage definition above main 2014-04-22 14:49:23 +01:00
dwts
575b38391c keep usage definition above main 2014-04-22 13:46:33 +01:00
sin
f488547779 Don't bail out if chmod(2) or chown(2) fails
Keep processing all the files specified.
2014-04-22 13:46:28 +01:00
dwts
b700d5a8ed minor style changes 2014-04-22 13:46:19 +01:00
Hiltjo Posthuma
59d0b5cd97 chown: add -R for compatability
Signed-off-by: Hiltjo Posthuma <hiltjo@codemadness.org>
2014-04-18 20:31:39 +01:00
Hiltjo Posthuma
cd194d96ad chown: fix out-of-bounds ((null) bad address error)
Signed-off-by: Hiltjo Posthuma <hiltjo@codemadness.org>
2014-04-18 20:31:28 +01:00
sin
1d5663672e Minor style changes to sort 2014-04-18 17:24:59 +01:00
Jakob Kramer
98a12cc146 sort: add -k, fix -u
Options  that are  specific to  a  single  key  definition are not
supported (e.g. "sort -k 2,3n -k 4,4").  Should you try to specify
such definitions, sort will  return with EXIT_FAILURE and an error
message.   Instead, all key definitions exclusively use the global
settings.

It always behaves like -b was set.
2014-04-18 13:43:32 +01:00
sin
02d91696b4 Fix char **argv to char *argv[] 2014-04-18 11:54:44 +01:00
Silvan Jegen
4e13ff39c3 Wrap mbtowc to check for errors 2014-04-12 21:29:16 +01:00
sin
bc13aa5960 No need to cast return value of mmap() in tr 2014-04-12 20:33:59 +01:00
Hiltjo Posthuma
9ad06c3aef update TODO file
Signed-off-by: Hiltjo Posthuma <hiltjo@codemadness.org>
2014-04-12 20:33:50 +01:00
Hiltjo Posthuma
1599880c93 update some man pages
*sum tools: -c was added
tr: -d flag was added.
xargs: -n flag was added.
cmp: minor typo (change to lowercase).

Signed-off-by: Hiltjo Posthuma <hiltjo@codemadness.org>
2014-04-12 20:33:33 +01:00
Hiltjo Posthuma
a8f45b4568 tr: change delete behaviour
when one argument is specified use delete behaviour again

Signed-off-by: Hiltjo Posthuma <hiltjo@codemadness.org>
2014-04-12 20:33:10 +01:00
sin
16cf92119f Fix missing '-' in usage 2014-04-09 18:20:50 +01:00
Hiltjo Posthuma
1be58188ad xargs: implement -n
Signed-off-by: Hiltjo Posthuma <hiltjo@codemadness.org>
2014-04-09 17:11:49 +01:00
Hiltjo Posthuma
6dd138613e cmp: suppress file open error with sflag
Signed-off-by: Hiltjo Posthuma <hiltjo@codemadness.org>
2014-04-09 15:40:44 +01:00
Hiltjo Posthuma
560340341f make parsemode() generic
use for uudecode and chmod

Signed-off-by: Hiltjo Posthuma <hiltjo@codemadness.org>
2014-04-09 15:40:32 +01:00