Corretta creazione dei cursori nel caso di un file vuoto
git-svn-id: svn://10.65.10.50/trunk@329 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
		
							parent
							
								
									3d4b0b3999
								
							
						
					
					
						commit
						947587269e
					
				@ -1,4 +1,4 @@
 | 
			
		||||
//      $Id: relation.cpp,v 1.14 1994-10-04 15:38:54 guy Exp $
 | 
			
		||||
//      $Id: relation.cpp,v 1.15 1994-10-07 14:55:43 alex Exp $
 | 
			
		||||
// relation.cpp
 | 
			
		||||
// fv 12/8/93
 | 
			
		||||
// relation class for isam files
 | 
			
		||||
@ -676,10 +676,14 @@ TRecnotype TCursor::buildcursor(TRecnotype rp)
 | 
			
		||||
  const int  kl = file().filehnd()->i.Base[file().filehnd()->i.PN].KeyLen;
 | 
			
		||||
  const bool filtered = has_filter();
 | 
			
		||||
 | 
			
		||||
  if (file().filehnd()->i.Base[file().filehnd()->i.PN].PEOD == 0)
 | 
			
		||||
    return 0;
 | 
			
		||||
 | 
			
		||||
  FILE* _f = open_index(TRUE);
 | 
			
		||||
  
 | 
			
		||||
  if (file().filehnd()->i.Base[file().filehnd()->i.PN].PEOD == 0)
 | 
			
		||||
  {
 | 
			
		||||
    fclose(_f);
 | 
			
		||||
    return 0;
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  fseek(_f, 0L, SEEK_SET);
 | 
			
		||||
 | 
			
		||||
  l = strlen(to());
 | 
			
		||||
@ -748,12 +752,6 @@ int TCursor::filtercursor(int pagecnt, TRecnotype* page)
 | 
			
		||||
{
 | 
			
		||||
  int np = 0;
 | 
			
		||||
  TRectype& rec = file().curr();
 | 
			
		||||
  //  const bool tab = file().tab();
 | 
			
		||||
  //  if (tab)
 | 
			
		||||
  //  {
 | 
			
		||||
  //    file().filehnd()->r->Fd[0].RecOff += 3;
 | 
			
		||||
  //    file().filehnd()->r->Fd[0].Len -= 3;
 | 
			
		||||
  //  }
 | 
			
		||||
  for (int i = 0; i < pagecnt; i++)
 | 
			
		||||
  {
 | 
			
		||||
    CRead(&file().filehnd()->f, rec.string(), page[i], _nolock);
 | 
			
		||||
@ -764,11 +762,6 @@ int TCursor::filtercursor(int pagecnt, TRecnotype* page)
 | 
			
		||||
      np++;
 | 
			
		||||
    }
 | 
			
		||||
  }
 | 
			
		||||
  //  if (tab)
 | 
			
		||||
  //  {
 | 
			
		||||
  //    file().filehnd()->r->Fd[0].RecOff -= 3;
 | 
			
		||||
  //    file().filehnd()->r->Fd[0].Len += 3;
 | 
			
		||||
  //  }
 | 
			
		||||
  return np;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
@ -1029,11 +1022,6 @@ TRecnotype TCursor::readrec()
 | 
			
		||||
 | 
			
		||||
  curr().setdirty();
 | 
			
		||||
  CRead(&file().filehnd()->f, curr().string(), nrec, _nolock);
 | 
			
		||||
  //  if (file().tab())
 | 
			
		||||
  //  {
 | 
			
		||||
  //    TRecfield   codtab(curr(), "CODTAB");
 | 
			
		||||
  //    codtab = (const char*)codtab + 3;
 | 
			
		||||
  //  }
 | 
			
		||||
  repos();
 | 
			
		||||
  return nrec;
 | 
			
		||||
}
 | 
			
		||||
@ -1257,3 +1245,4 @@ int TFieldref::len(TRectype &rec) const
 | 
			
		||||
 | 
			
		||||
// *** EOF relation.cpp
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user