RAWTAP: Fix initial tapemark problem.

If the first record in a container file was a tape mark, the tape was, incorrectly, assumed to be empty.
This commit is contained in:
John Forecast 2017-12-14 17:06:51 -08:00 committed by Mark Pizzolato
parent 928d137f17
commit 18202f1b8d

View File

@ -114,7 +114,7 @@ int main(
)
{
int readError = 0, writeError = 0;
char *s, filename[16];
char *s, filename[16], bot;
FILE *file;
unsigned int status;
@ -233,6 +233,8 @@ int main(
usage();
while (argc >= 1) {
bot = 1;
switch (OpenTapeForRead(argv[0])) {
case TIO_SUCCESS:
case TIO_ERROR:
@ -245,8 +247,11 @@ int main(
break;
case ST_TM:
/* Second tape mark in a row - treat as end of medium */
status = ST_EOM;
/* Ignore tape mark at the beginning pf a container */
if (!bot) {
/* Second tape mark in a row - treat as end of medium */
status = ST_EOM;
}
break;
default:
@ -268,6 +273,7 @@ int main(
}
break;
}
bot = 0;
} while (status != ST_EOM);
CloseTape();
break;