Don't allow `--stdout' when compressing.
committer: mfx <mfx> 980433841 +0000
This commit is contained in:
@@ -122,10 +122,12 @@ public:
|
|||||||
// FIXME - these won't work when using the `--stdout' option
|
// FIXME - these won't work when using the `--stdout' option
|
||||||
virtual void seek(off_t off, int whence)
|
virtual void seek(off_t off, int whence)
|
||||||
{
|
{
|
||||||
|
assert(!opt->to_stdout);
|
||||||
super::seek(off,whence);
|
super::seek(off,whence);
|
||||||
}
|
}
|
||||||
virtual void rewrite(const void *buf, int len)
|
virtual void rewrite(const void *buf, int len)
|
||||||
{
|
{
|
||||||
|
assert(!opt->to_stdout);
|
||||||
write(buf, len);
|
write(buf, len);
|
||||||
bytes_written -= len; // restore
|
bytes_written -= len; // restore
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -229,6 +229,11 @@ void check_options(int i, int argc)
|
|||||||
opt->backup = 1;
|
opt->backup = 1;
|
||||||
|
|
||||||
check_not_both(opt->to_stdout, opt->output_name != NULL, "--stdout", "-o");
|
check_not_both(opt->to_stdout, opt->output_name != NULL, "--stdout", "-o");
|
||||||
|
if (opt->to_stdout && opt->cmd == CMD_COMPRESS)
|
||||||
|
{
|
||||||
|
fprintf(stderr,"%s: cannot use `--stdout' when compressing\n", argv0);
|
||||||
|
e_usage();
|
||||||
|
}
|
||||||
if (opt->to_stdout || opt->output_name)
|
if (opt->to_stdout || opt->output_name)
|
||||||
{
|
{
|
||||||
if (i + 1 != argc)
|
if (i + 1 != argc)
|
||||||
|
|||||||
Reference in New Issue
Block a user