From 4e7e66d4dc14513e1beed465fc5180429571921b Mon Sep 17 00:00:00 2001 From: Jeffrey Altman Date: Thu, 14 Aug 2008 03:32:54 +0000 Subject: [PATCH] windows-search-cell-file-20080813 LICENSE MIT if a cell has been found with addresses and the next cell name is reached before the EOF, return success. If the cell has been found and there are no addresses, return -6 --- src/WINNT/afsd/cm_config.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/WINNT/afsd/cm_config.c b/src/WINNT/afsd/cm_config.c index df46e0060..1c11f4860 100644 --- a/src/WINNT/afsd/cm_config.c +++ b/src/WINNT/afsd/cm_config.c @@ -124,7 +124,7 @@ long cm_SearchCellFile(char *cellNamep, char *newCellNamep, struct hostent *thp; char *valuep; struct sockaddr_in vlSockAddr; - int inRightCell; + int inRightCell = 0; int foundCell = 0; long code; int tracking = 1, partial = 0; @@ -146,7 +146,6 @@ long cm_SearchCellFile(char *cellNamep, char *newCellNamep, osi_LogSaveString(afsd_logp,wdir)); #endif /* have we seen the cell line for the guy we're looking for? */ - inRightCell = 0; while (1) { tp = fgets(lineBuffer, sizeof(lineBuffer), tfilep); if (tracking) @@ -185,10 +184,9 @@ long cm_SearchCellFile(char *cellNamep, char *newCellNamep, if (lineBuffer[0] == '>') { if (inRightCell) { - /* no addresses for cell */ fclose(tfilep); fclose(bestp); - return -6; + return(foundCell ? 0 : -6); } /* trim off at white space or '#' chars */ -- 2.39.5