home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 October / usenetsourcesnewsgroupsinfomagicoctober1994disk2.iso / misc / volume38 / libftp / part01 / FtpRead.c < prev    next >
C/C++ Source or Header  |  1993-07-13  |  414b  |  31 lines

  1. #include "FtpLibrary.h"
  2.  
  3. int FtpRead(FTP *con)
  4. {
  5.   int c;
  6.   
  7.   if ( con -> mode == 'I' )
  8.     return getc(con->data);
  9.   
  10.   if ( con->ch != EOF )
  11.     {
  12.       c=con->ch;
  13.       con->ch=EOF;
  14.       return c;
  15.     }
  16.   
  17.   c=getc(con->data);
  18.   
  19.   if ( c == Ctrl('M') )
  20.     {
  21.       c = getc ( con->data);
  22.       
  23.       if ( c == Ctrl('J') )
  24.         return '\n';
  25.       con->ch = c;
  26.       return Ctrl('M');
  27.     }
  28.   return c;
  29. }
  30.       
  31.