Commit Graph

1244 Commits

Author SHA1 Message Date
Ashwini Sharma
882ca8bf5b _mkflags_ had an issue for generating FLAG_xxxx macros for long options.
Only the first __long__ option, without any __short__ option had a proper
flag value, rest all were defined to ZERO. Becaus the _flist_ was not moved
to the next in this case.
2014-04-09 07:40:02 -05:00
Rob Landley
e6314da6fe generated/help.h is a lot easier to read with an extra newline between each help entry. 2014-04-07 12:53:24 -05:00
Isaac Dunham
6f9d481062 openvt tries opening several devices to get an fd that points to the current console, without a need for read or write permissions. O_RDWR implies that both O_RDONLY and O_WRONLY would work, so skip it. Reindent. 2014-04-03 22:43:28 -05:00
Samuel Holland
547c8d980b Here is a basic implementation of fold[0]. It does not support multibyte characters, though that would probably just require more switch cases. 2014-04-03 18:01:44 -05:00
Rob Landley
7183a63743 Decided not to go with the sflate implementation of deflate/inflate. The decompression side's already reimplemented in compress, and I'm working on compression side. 2014-04-02 06:37:14 -05:00
Ashwini Sharma
18720dc21a In ifconfig.c, there is a glitch in function get_addrinfo() when computing the prefix length. 2014-04-02 06:35:33 -05:00
Rob Landley
2b0b548381 New toy fsfreeze, from Isaac Dunham, plus minor cleanups. 2014-04-01 18:20:00 -05:00
Rob Landley
52ab00b608 bugfix: the multiplexer increments optc and then the command the multiplexer runs increments it further, resulting in a wrong count. Fix: zero it. 2014-04-01 18:18:46 -05:00
Rob Landley
5b405827a2 Group headers by standard (POSIX or LSB) or function (internationalization, networking). Move headers standards ignore (but which have been there >15 years) to lib/portability.h. Fold xregcomp into lib since it's posix. 2014-03-29 18:11:00 -05:00
Isaac Dunham
d4f01257d9 find: clarify and expand the help for find -type 2014-03-29 15:25:23 -05:00
Rob Landley
4b0341f429 Add help.html (make defconfig && help -ah > help.html) to index. 2014-03-28 22:55:30 -05:00
Rob Landley
36aa7d7382 Add help -a (to show all commands) and -h (to produce HTML output). 2014-03-28 17:48:02 -05:00
Isaac Dunham
e9a41fc5ae Fix cpio -it: don't close(fd) unless we opened it. 2014-03-27 07:02:01 -05:00
Rob Landley
392e12769f More cpio bugfixes from Isaac Dunham.
Fix FLAG_o to actually be 1 like the comment says, don't try to strlen(name) before reading it, pad TRAILER!!! entry correctly.
2014-03-26 06:07:06 -05:00
Rob Landley
a2d558151a Promote cpio out of pending.
After some waffling I put it in "posix", even though it was last specified in
susv2 (where it was the obsolete 6 byte header entries predating susv4).

LSB specifies it, including the 8 byte header fields, but for the actual
command it just references SUSv2. (LSB isn't so much a standard as Red Hat's
"notes to self".)
2014-03-25 07:35:56 -05:00
Rob Landley
6d796b61a6 Several cpio bugfixes spotted by Isaac Dunham. 2014-03-25 07:24:50 -05:00
Rob Landley
dba5a37b9d Most of the remaining cpio cleanup. 2014-03-24 08:19:21 -05:00
Rob Landley
02f5a30ec0 Fix mkdir -p with absolute paths.
Stripping leading / is not the right thing to do there.
Broken when the code moved to lib and was genericized for use elsewhere.
2014-03-24 06:26:49 -05:00
Ashwini Sharma
64f6164088 There are cases when the long options are of the format abc-def. In current implementation FLAG_xxx macros are generated for long options too. with __-__ sign in the macro, it will generate errors.
I am of the opinion that __-__ be converted to '_' for generating the FLAG_xxx macros and be used in the command.

This will enable the user to 'abc-def', but be handled like 'abc_def' in code.
2014-03-19 13:57:06 -05:00
Rob Landley
817d97ba62 Clarify an unclear comment pointed out by Steve Long. 2014-03-16 16:27:38 -05:00
Rob Landley
9ea9911b20 Next round of cpio cleanup. 2014-03-15 15:41:09 -05:00
Rob Landley
2c451a89be Cleanup cpio: use getline() instead of fgets(), have getline() allocate its own memory (instead of using toybuf), use perror_msg() instead of lower level verror_msg() (which is really an internal function needed to implement perror_msg()), don't set execute bits on created archive. 2014-03-13 19:55:59 -05:00
Rob Landley
bab79fe8d6 Cleanup cpio: fiddle with help text, make option parsing require/exclude -iot combinations, move loopfiles_stdin() down after write_cpio_member() so we can hardwire it instead of using a function pointer that only ever has one value. 2014-03-13 19:42:42 -05:00
Rob Landley
c8f379c1f7 Patch from Isaac Dunham to add cpio -d, with a few tweaks by me. 2014-03-11 21:10:45 -05:00
Rob Landley
ca1b60e3bd Move mkpathat to lib, remove redundant function used by patch. 2014-03-11 20:44:55 -05:00
Rob Landley
a8b88fe472 Add "volatile" annotation to peek/poke to stop potential optimizer overreach. 2014-03-11 18:11:12 -05:00
Rob Landley
fad38c7d16 Factor out mkpathat. 2014-03-11 17:50:17 -05:00
Rob Landley
69664c24a1 Promote freeramdisk from pending to other, default y. 2014-03-09 14:42:28 -05:00
Rob Landley
d96e0ba792 Cleanup freeramdisk: tabs to 2 spaces, square brackets for option name, do optional cleanup under if (CFG_TOYBOX_FREE) guard. 2014-03-09 14:38:51 -05:00
Vivek Bhagat
728b8ff0a0 Please find the patches attached herewith for adding 3 new commands -
1. freeramdisk - If we unmount or detach the RAM disk based file system the Linux Kernel
   will not free the allocated memory associated with the RAM device. This can be useful if
   one wants to mount this device again:  All data will be preserved.
   If we need to free the memory back to the Kernel, one can use the command: "toybox freeramdisk <RAM device>".

2. openvt - Successfully opens a new virtual terminal as mentioned with -c option
        otherwise search and open next available VT.
with -s option it switches to new VT
with -s -w option, it switch back successfully to originating VT.

3. deallocvt - Deallocate specified virtual teminal.
   if no virtual terminal is specified, it deallocates all unused VT.
2014-03-09 14:27:11 -05:00
Rob Landley
4d886d6951 Broken URL that's been pointed out to me a couple times when I'm not at a machine I can fix it from, keep forgetting... 2014-03-08 19:26:33 -06:00
Rob Landley
4dd800cb57 Fix another bug reported by Ashwini Sharma. 2014-02-28 23:10:03 -06:00
Rob Landley
da60b9b163 Fix two bugs reported by Ashwini Sharma. 2014-02-28 23:04:57 -06:00
Rob Landley
170c397576 Fix header file generation to not be confused by empty (but non-NULL) option string.
You shouldn't use "" as an option string because a NULL allows toy_init()
to avoid calling the option parsing logic entirely, which lets it drop out
when nothing's using it (ala scripts/single.sh builds). That said, init.c
is currently using a "" option string and a USE_ macro taking advantage
of string concatenation may require a "" option config, so...
2014-02-28 20:46:16 -06:00
Rob Landley
6ebe03d616 Put all FOR_xxx blocks after all CLEANUP_xxx in generated/flags.h so the usages don't have to be in alphabetical order. 2014-02-24 23:34:43 -06:00
Rob Landley
e36a9dda21 CLEANUP transitions require all the generated/flags.h stanzas always be present (even for commands disabled in the config) to avoid undefined symbol errors referencing FLAG_ macros. 2014-02-23 20:11:06 -06:00
Rob Landley
2992a66e2c Add -H option to cksum (hex output), fix to use FLAG macros. 2014-02-22 08:02:09 -06:00
Rob Landley
fa1625d84e Add crc code: zcat now works. 2014-02-22 08:01:11 -06:00
Rob Landley
7dbb9826d2 Update status page. 2014-02-21 22:24:02 -06:00
Rob Landley
c5dabf1364 Update inflate code: fixed tables, bugfixes, zcat alias. 2014-02-21 22:21:59 -06:00
Rob Landley
a2359011a8 Make CLEANUP transitions work, so multiple NEWTOY() can exist in the same file.
Don't #undefine TT in the CLEANUP blocks of generated/flags.h, and #ifdef
around the other TT definition. That way you can put a union at the start
of your GLOBALS() with the arguments filled out by option parsing, and then
have multiple main() functions with different argumetns and different
FLAG_x macros, while sharing infrastructure that's not under lib.
2014-02-16 17:31:33 -06:00
Rob Landley
1fb3ae7075 Various cleanups found by Tom Sparrow's static analysis. 2014-02-16 11:09:23 -06:00
Rob Landley
33b022d873 Ok, _maybe_ I'm rewriting deflate from scratch rather than cleaning up the existing one, but you can't prove it. I plead the fifth, third, twelvefth, twentieth, twenty-first, twenth-fith, and twenty-seventh. 2014-02-13 06:45:35 -06:00
Rob Landley
3cd89c3f64 Not buying it, eh? 2014-02-10 08:30:05 -06:00
Rob Landley
b34b237e62 Nothing to see here, move along. 2014-02-08 13:37:57 -06:00
Rob Landley
5a2583ac4f Fix segfault with single build of a command with bare longopts. 2014-02-08 10:53:26 -06:00
Rob Landley
b6c8a8609f Move bunzip2 logic from lib into bzcat. 2014-02-07 07:56:46 -06:00
Rob Landley
5486075cae Tweak help text. 2014-02-04 06:20:14 -06:00
Rob Landley
a89f8aa4f9 More cleanup.html documentation, still way behind... 2014-02-04 06:16:44 -06:00
Rob Landley
0e040df95b Use right config for single builds. 2014-02-04 06:14:30 -06:00