Mercurial > hg > toybox
annotate toys/bzcat.c @ 241:4121825716b8
Fix crash when running unknown command via symlink.
(The error message was trying to print an uninitialied field. Oops.)
author | Rob Landley <rob@landley.net> |
---|---|
date | Tue, 22 Jan 2008 15:33:50 -0600 |
parents | 163498bf547b |
children | 937148640ac5 |
rev | line source |
---|---|
233
d4176f3f3835
Zap toys/Config.in and instead create generated/Config.in from contents of
Rob Landley <rob@landley.net>
parents:
186
diff
changeset
|
1 /* vi: set sw=4 ts=4: |
d4176f3f3835
Zap toys/Config.in and instead create generated/Config.in from contents of
Rob Landley <rob@landley.net>
parents:
186
diff
changeset
|
2 * |
54
60a7fb8ddeb4
Add a quick and dirt bzcat (stdin to stdout only for the moment) to test
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
3 * bzcat.c - decompress stdin to stdout using bunzip2. |
233
d4176f3f3835
Zap toys/Config.in and instead create generated/Config.in from contents of
Rob Landley <rob@landley.net>
parents:
186
diff
changeset
|
4 * |
d4176f3f3835
Zap toys/Config.in and instead create generated/Config.in from contents of
Rob Landley <rob@landley.net>
parents:
186
diff
changeset
|
5 * Copyright 2007 Rob Landley <rob@landley.net> |
d4176f3f3835
Zap toys/Config.in and instead create generated/Config.in from contents of
Rob Landley <rob@landley.net>
parents:
186
diff
changeset
|
6 * |
d4176f3f3835
Zap toys/Config.in and instead create generated/Config.in from contents of
Rob Landley <rob@landley.net>
parents:
186
diff
changeset
|
7 * Not in SUSv3. |
d4176f3f3835
Zap toys/Config.in and instead create generated/Config.in from contents of
Rob Landley <rob@landley.net>
parents:
186
diff
changeset
|
8 |
234
163498bf547b
Move NEWTOY() list from end of toylist.h to generated/newtoys.h.
Rob Landley <rob@landley.net>
parents:
233
diff
changeset
|
9 USE_BZCAT(NEWTOY(bzcat, NULL, TOYFLAG_USR|TOYFLAG_BIN)) |
163498bf547b
Move NEWTOY() list from end of toylist.h to generated/newtoys.h.
Rob Landley <rob@landley.net>
parents:
233
diff
changeset
|
10 |
233
d4176f3f3835
Zap toys/Config.in and instead create generated/Config.in from contents of
Rob Landley <rob@landley.net>
parents:
186
diff
changeset
|
11 config BZCAT |
d4176f3f3835
Zap toys/Config.in and instead create generated/Config.in from contents of
Rob Landley <rob@landley.net>
parents:
186
diff
changeset
|
12 bool "bzcat" |
d4176f3f3835
Zap toys/Config.in and instead create generated/Config.in from contents of
Rob Landley <rob@landley.net>
parents:
186
diff
changeset
|
13 default n |
d4176f3f3835
Zap toys/Config.in and instead create generated/Config.in from contents of
Rob Landley <rob@landley.net>
parents:
186
diff
changeset
|
14 help |
d4176f3f3835
Zap toys/Config.in and instead create generated/Config.in from contents of
Rob Landley <rob@landley.net>
parents:
186
diff
changeset
|
15 usage: bzcat [filename...] |
d4176f3f3835
Zap toys/Config.in and instead create generated/Config.in from contents of
Rob Landley <rob@landley.net>
parents:
186
diff
changeset
|
16 |
d4176f3f3835
Zap toys/Config.in and instead create generated/Config.in from contents of
Rob Landley <rob@landley.net>
parents:
186
diff
changeset
|
17 Decompress listed files to stdout. Use stdin if no files listed. |
d4176f3f3835
Zap toys/Config.in and instead create generated/Config.in from contents of
Rob Landley <rob@landley.net>
parents:
186
diff
changeset
|
18 */ |
54
60a7fb8ddeb4
Add a quick and dirt bzcat (stdin to stdout only for the moment) to test
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
19 |
60a7fb8ddeb4
Add a quick and dirt bzcat (stdin to stdout only for the moment) to test
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
20 #include "toys.h" |
60a7fb8ddeb4
Add a quick and dirt bzcat (stdin to stdout only for the moment) to test
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
21 |
186
25447caf1b4b
Change command main() functions to return void, and exit(toys.exitval) from
Rob Landley <rob@landley.net>
parents:
64
diff
changeset
|
22 void bzcat_main(void) |
54
60a7fb8ddeb4
Add a quick and dirt bzcat (stdin to stdout only for the moment) to test
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
23 { |
64
67ee3a0b76e1
In bunzip replace setjmp/longjmp handling with error_exit(), replace string
Rob Landley <rob@landley.net>
parents:
54
diff
changeset
|
24 bunzipStream(0, 1); |
54
60a7fb8ddeb4
Add a quick and dirt bzcat (stdin to stdout only for the moment) to test
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
25 } |