Subject: Re: pax-as-tar extract to stdout patch
To: Simon Burge <simonb@wasabisystems.com>
From: enami tsugutomo <enami@sm.sony.co.jp>
List: tech-userlevel
Date: 06/17/2003 10:13:51
Simon Burge <simonb@wasabisystems.com> writes:

> @@ -1076,9 +1076,17 @@ tar_options(int argc, char **argv)
>  	if (act == ARCHIVE || act == APPND)
>  		frmt = &(fsub[Oflag ? F_TAR : F_USTAR]);
>  	else if (Oflag) {
> -		tty_warn(1, "The -O/-o options are only valid when writing an archive");
> -		tar_usage();		/* only valid when writing */
> +		if (act == EXTRACT)
> +			to_stdout = 1;
> +		else {
> +			tty_warn(1, "The -O/-o options are only valid when "
> +			    "writing or extracting an archive");
> +			tar_usage();
> +		}
>  	}
> +
> +	if (act == EXTRACT && Oflag)
> +		to_stdout = 1;
>  
>  	/*
>  	 * process the args as they are interpreted by the operation mode

The last if-statement is redundant, isn't it?

enami.