From 5bbb0926a5e765575c199573ea3b3d0f5ecd99a2 Mon Sep 17 00:00:00 2001 From: Stelian Pop Date: Wed, 18 Jul 2001 11:46:31 +0000 Subject: [PATCH] Discard newline when reading the tape path entered by the operator in restore. --- CHANGES | 5 ++++- restore/tape.c | 5 ++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/CHANGES b/CHANGES index a46e316..2565dec 100644 --- a/CHANGES +++ b/CHANGES @@ -1,4 +1,4 @@ -$Id: CHANGES,v 1.120 2001/07/18 09:50:48 stelian Exp $ +$Id: CHANGES,v 1.121 2001/07/18 11:46:31 stelian Exp $ Changes between versions 0.4b22 and 0.4b23 (released ????????????) ================================================================== @@ -26,6 +26,9 @@ Changes between versions 0.4b22 and 0.4b23 (released ????????????) Patch contributed by Helmut Jarausch . +7. Fixed a bug in reading the operator typed file/tape path for + the next volume in restore. + Changes between versions 0.4b21 and 0.4b22 (released May 12, 2001) ================================================================== diff --git a/restore/tape.c b/restore/tape.c index ee5c72f..f7a8a10 100644 --- a/restore/tape.c +++ b/restore/tape.c @@ -46,7 +46,7 @@ #ifndef lint static const char rcsid[] = - "$Id: tape.c,v 1.40 2001/06/18 10:58:28 stelian Exp $"; + "$Id: tape.c,v 1.41 2001/07/18 11:46:31 stelian Exp $"; #endif /* not lint */ #include @@ -452,8 +452,11 @@ again: return; } if (buf[0] != '\n') { + char *pos; (void) strncpy(magtape, buf, sizeof(magtape)); magtape[sizeof(magtape) - 1] = '\0'; + if ((pos = strchr(magtape, '\n'))) + magtape[pos - magtape] = '\0'; } } #ifdef RRESTORE -- 2.39.5