commit | 2983330512e0f1a09ef881034a5e1c02d3fe2c7b | [log] [tgz] |
---|---|---|
author | Glenn L McGrath <bug1@ihug.co.nz> | Sun Oct 06 23:25:23 2002 +0000 |
committer | Glenn L McGrath <bug1@ihug.co.nz> | Sun Oct 06 23:25:23 2002 +0000 |
tree | df089bbada7e04d0e7af1bbaade56c9c98a5aa82 | |
parent | e0f5500bb577addcd26217737401f83c5cd293c2 [diff] |
Fix segfault when testing if reaidng from stdin "-"
diff --git a/archival/tar.c b/archival/tar.c index 88a815d..e6c134e 100644 --- a/archival/tar.c +++ b/archival/tar.c
@@ -694,7 +694,9 @@ } } - if (*argv[optind] == '-') { + /* Check if we are reading from stdin */ + if ((argv[optind]) && (*argv[optind] == '-')) { + /* Default is to read from stdin, so just skip to next arg */ optind++; }