From 4f94452b3d04736ed24c99d1f267853f818528d5 Mon Sep 17 00:00:00 2001 From: Stelian Pop Date: Sat, 19 Aug 2000 23:15:38 +0000 Subject: [PATCH] Off by one miscalculation (dumping a one letter directory). --- CHANGES | 7 ++++++- THANKS | 3 ++- dump/optr.c | 4 ++-- 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/CHANGES b/CHANGES index 635146b..7fd7c00 100644 --- a/CHANGES +++ b/CHANGES @@ -1,4 +1,4 @@ -$Id: CHANGES,v 1.71 2000/08/19 22:39:35 stelian Exp $ +$Id: CHANGES,v 1.72 2000/08/19 23:15:38 stelian Exp $ Changes between versions 0.4b17 and 0.4b19 (released ?????????????) =================================================================== @@ -14,6 +14,11 @@ Changes between versions 0.4b17 and 0.4b19 (released ?????????????) or warnings. Thanks to Stephen Atwell for the suggestion. +4. Corrected an off by one calculation which prevented + dumping a directory having a 1 character name length. + Thanks to Bernhard Erdmann + for reporting the bug. + Changes between versions 0.4b17 and 0.4b18 (released June 30, 2000) =================================================================== diff --git a/THANKS b/THANKS index 7826863..e35c14c 100644 --- a/THANKS +++ b/THANKS @@ -1,4 +1,4 @@ -$Id: THANKS,v 1.32 2000/08/19 22:39:35 stelian Exp $ +$Id: THANKS,v 1.33 2000/08/19 23:15:38 stelian Exp $ Dump and restore were written by the people of the CSRG at the University of California, Berkeley. @@ -30,6 +30,7 @@ Rainer Clasen bj@ncc.cicely.de W. Reilly Cooley wcooley@nakedape.cc Abhijit Dasgupta abhijit@ans.net Andreas Dilger adilger@home.com +Bernhard Erdmann bernhard.erdmann@gmx.de Jason Fearon jasonf@netrider.org.au Jeremy Fitzhardinge jeremy@goop.org Eirik Fuller eirik@netcom.com diff --git a/dump/optr.c b/dump/optr.c index de1d6f6..4102537 100644 --- a/dump/optr.c +++ b/dump/optr.c @@ -40,7 +40,7 @@ #ifndef lint static const char rcsid[] = - "$Id: optr.c,v 1.10 2000/02/10 09:42:32 stelian Exp $"; + "$Id: optr.c,v 1.11 2000/08/19 23:15:38 stelian Exp $"; #endif /* not lint */ #include @@ -529,7 +529,7 @@ fstabsearchdir(const char *key, char *directory) for (pf = table; pf != NULL; pf = pf->pf_next) { fs = pf->pf_fstab; if (strlen(fs->fs_file) > size && - strlen(key) > strlen(fs->fs_file) + 2 && + strlen(key) > strlen(fs->fs_file) + 1 && strncmp(fs->fs_file, key, strlen(fs->fs_file)) == 0 && (key[strlen(fs->fs_file)] == '/' || fs->fs_file[strlen(fs->fs_file) - 1] == '/')) { -- 2.39.5