Commit Graph

1090 Commits

Author SHA1 Message Date
sin 8d53fc9a79 rm: Remove -i from usage and manpage
We do not support it so do not lie to the user.
2015-02-19 14:54:12 +00:00
Quentin Rameau bf5f6a08a4 README: added options for date, ls, touch 2015-02-19 14:45:13 +00:00
sin 9355d88aae Add COLUMNS support to cols(1)
First attempt to see if COLUMNS is set, if that fails an ioctl()
is issued to find the width of the output device.  If that fails
as well, we default to 65 chars per line.
2015-02-19 11:25:51 +00:00
FRIGN 8c041cd115 Don't terminate du(1) if chdir(2) fails 2015-02-18 22:04:32 +01:00
sin 2137dfa334 Mark du(1) as finished in README 2015-02-18 20:43:46 +00:00
sin d9085e9078 Update manpage for du(1) 2015-02-18 20:42:23 +00:00
sin 14b95b5f53 Mark du -x as done in the README 2015-02-18 20:41:37 +00:00
Quentin Rameau 593effc7c8 Add -x support for du(1) 2015-02-18 20:40:34 +00:00
sin 9d2b94dbb0 cp: Remove unnecessary comment
Not to mention that -d doesn't exist.
2015-02-18 17:08:52 +00:00
sin e635760742 Fix ls when -q is not set
Use strdup() unconditionally.
2015-02-18 16:48:07 +00:00
sin d40333e702 Fix ls -q UTF-8 parsing
Thanks FRIGN for the input.
2015-02-18 16:43:18 +00:00
sin 2a3f82a5cd Implement -u support for ls(1) 2015-02-18 16:29:46 +00:00
sin 9bd094193d Simplify ls -q implementation 2015-02-18 15:55:57 +00:00
sin 93cc2ecc5c du: Fix typo in manpage 2015-02-18 15:20:42 +00:00
FRIGN a331ac3a03 Update LICENSE 2015-02-18 12:30:34 +01:00
FRIGN 767e36e410 sed(1): Add back line numbers to compiler error messages 2015-02-18 11:43:34 +01:00
FRIGN 4391984115 Use e-functions in sed(1)
and take off the tin-foil-head by removing checks for printf-return-
values.
2015-02-18 11:21:56 +01:00
FRIGN a98405d277 Refactor sed(1) a bit
Well, isspacerune() has been fixed and some other FIXME's were also easy
to do.
There are some places where maybe some util-functions could be helpful.
In some cases, like for instance in regard to escape-sequences, I'm all
for consistency rather than adhering to the POSIX-standard too much.
Relying on centralized util-functions also makes it possible to keep
this consistency across the board.
2015-02-18 10:51:39 +01:00
FRIGN 6b719faade Add q-flag to ls(1)
of course, UTF-8-aware. ;)
2015-02-17 18:59:01 +01:00
FRIGN ef23f966c5 Refactor strings(1) loop again
fixing a little out-of-bounds write.
2015-02-17 18:18:54 +01:00
FRIGN 439bf8a157 Fix small issue in strings(1) loop
It wouldn't print the len'th character.
2015-02-17 18:11:59 +01:00
sin aa6ac30b81 chown: Update program usage and manpage 2015-02-17 16:41:58 +00:00
sin 16719ea6e1 cp: Update program usage and manpages
Do not document the non-standard -r flag as it is highly discouraged.
It is still silently accepted and treated the same as -R.
2015-02-17 16:14:42 +00:00
sin 6c31f1d2a8 du: Update usage and document -P as well 2015-02-17 16:14:31 +00:00
FRIGN e5b5497773 Add UTF-8-support to strings(1), add t-flag and refactor code
Previously, the string-length was limited to BUFSIZ, which is an
obvious deficiency.
Now the buffer only needs to be as long as the user specifies the
minimal string length.
I added UTF-8-support, because that's how POSIX wants it and there
are cases where you need this. It doesn't add ELF-barf compared to
the previous implementation.
The t-flag is also pretty important for POSIX-compliance, so I added
it.
The only trouble previously was the a-flag, but given that POSIX
leaves undefined what the a-flag actually does, we set it as default
and don't care about parsing ELF-headers, which has already
turned out to be a security issue in GNU coreutils[0].

[0]: http://lcamtuf.blogspot.ro/2014/10/psa-dont-run-strings-on-untrusted-files.html
2015-02-17 17:04:36 +01:00
sin 949dafc171 strings: The default minimum length sequence is 4 characters not 6 2015-02-17 13:55:44 +00:00
sin 4904f26e5d strings: Remember to include limits.h for INT_MAX 2015-02-17 13:50:10 +00:00
sin d8a89002d3 strings: Add -n len support 2015-02-17 13:46:48 +00:00
sin 8ce6d7091a strings: Default to -a 2015-02-17 13:40:36 +00:00
sin 9effb224c8 expand, unexpand: Minor style fix as per the suckless guide 2015-02-17 12:14:44 +00:00
sin 29be7a3f23 tar: Style fix 2015-02-17 09:13:15 +00:00
FRIGN e77f0b0b9f Simplify sha*sum.c 2015-02-17 10:08:28 +01:00
FRIGN 8e016fad91 Make the tar(1)-header fixed again
This is clearer.
2015-02-16 20:01:33 +01:00
FRIGN eb17f2cc9c Refactor tar(1) 2015-02-16 19:47:36 +01:00
FRIGN bec3c32dbd Refactor ls(1) 2015-02-16 19:20:06 +01:00
sin 9da1deaab9 chmod: Add -HLP flags and update manpage 2015-02-16 16:47:07 +00:00
sin 1d05b293e1 chgrp: Update program usage and manpage
-h is incompatible with -R so handle that properly as well.
2015-02-16 16:33:39 +00:00
sin 8f068589fb Fix recurse() prototype and convert char to int flags 2015-02-16 16:23:12 +00:00
sin d8fa891008 Remove redundant definition of argv0 2015-02-16 16:12:36 +00:00
Tai Chi Minh Ralph Eastwood 7a5c4e3a29 Update README for chown, chgrp -H -L -P 2015-02-16 15:54:00 +00:00
Tai Chi Minh Ralph Eastwood 0cf6a18f6f recurse: change char follow to int follow 2015-02-16 15:53:58 +00:00
Tai Chi Minh Ralph Eastwood 82bc92da51 recurse: add symlink derefencing flags -H and -L 2015-02-16 15:53:55 +00:00
FRIGN 5a13865385 Fix \c behaviour
The loop magic broke along the way. Just drop that and write a
proper early exit (= termination).
Now it should work as expected.
2015-02-16 10:31:13 +01:00
Tai Chi Minh Ralph Eastwood 26168d5c37 uudecode: fix error msgs (newlines, no output name) 2015-02-15 19:37:17 +00:00
sin 92b14e9c77 Use BSD style function definitions 2015-02-15 16:00:32 +00:00
FRIGN 9418101293 Fix isprintrune()'s behaviour
I somehow missed this issue. A rune can not be smaller than the left
range-delimiter and bigger than the right range-delimiter at the
same time.
The real check has to check if either condition applies.
2015-02-15 16:27:45 +01:00
FRIGN dc3a2ffc4a Handle empty format string in printf(1) 2015-02-15 15:20:32 +01:00
FRIGN 5c8a9b375f Update escape-sequence information in tr.1 2015-02-15 14:56:49 +01:00
FRIGN bafd41e1cf Add printf(1)
This is a particularly interesting program.
I managed to implement everything according to POSIX except how
octal escapes are specified in the standard, which is yet another
format compared to the one demanded for tr(1).
This not only confuses people, it also adds unnecessary cruft
for no real gain.
So in order to be able to use unescape() easily and for consistency,
I used our initial format \o[oo] instead of \0[ooo].

Marked as optional is UTF-8 support for %c in the POSIX specification.
Given how well-developed libutf has become, doing this here was more
or less trivial, putting us yet again ahead of the competition.
2015-02-15 14:46:58 +01:00
FRIGN d7a438b2f8 Add \e, \", \' and hex-escapes (\xH[H]) to unescape()
So the users control the program, and the program doesn't
control the users.
2015-02-14 22:55:37 +01:00