-/* $OpenBSD: options.c,v 1.90 2015/04/18 18:28:37 deraadt Exp $ */
+/* $OpenBSD: options.c,v 1.91 2015/05/18 20:26:16 czarkoff Exp $ */
/* $NetBSD: options.c,v 1.6 1996/03/26 23:54:18 mrg Exp $ */
/*-
argc -= optind;
argv += optind;
+ if (!fstdin && ((arcname == NULL) || (*arcname == '\0'))) {
+ arcname = getenv("TAPE");
+ if ((arcname == NULL) || (*arcname == '\0'))
+ arcname = _PATH_DEFTAPE;
+ else if ((arcname[0] == '-') && (arcname[1]== '\0')) {
+ arcname = NULL;
+ fstdin = 1;
+ }
+ }
+
/* Traditional tar behaviour (pax uses stderr unless in list mode) */
if (fstdin == 1 && act == ARCHIVE)
listf = stderr;
maxflt = 0;
break;
}
- if (!fstdin && ((arcname == NULL) || (*arcname == '\0'))) {
- arcname = getenv("TAPE");
- if ((arcname == NULL) || (*arcname == '\0'))
- arcname = _PATH_DEFTAPE;
- }
}
int mkpath(char *);
-.\" $OpenBSD: tar.1,v 1.57 2015/01/15 19:06:31 schwarze Exp $
+.\" $OpenBSD: tar.1,v 1.58 2015/05/18 20:26:16 czarkoff Exp $
.\"
.\" Copyright (c) 1996 SigmaSoft, Th. Lockert
.\" All rights reserved.
.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
.\"
-.Dd $Mdocdate: January 15 2015 $
+.Dd $Mdocdate: May 18 2015 $
.Dt TAR 1
.Os
.Sh NAME
Filename where the archive is stored.
Defaults to
.Pa /dev/rst0 .
+If set to hyphen
+.Pq Sq -
+standard output is used.
+See also the
+.Ev TAPE
+environment variable.
.It Fl H
Follow symlinks given on the command line only.
.It Fl h
.It Ev TAPE
Default tape device to use instead of
.Pa /dev/rst0 .
+If set to hyphen
+.Pq Sq -
+standard output is used.
.El
.Sh FILES
.Bl -tag -width "/dev/rst0"