third_party/inchi/INCHI_BASE/src/ichi_io.c
char *inchi_fgetsTab( char *szLine, int len, FILE *f )
{
    int  length = 0, c = 0;
    len--;
    while (length < len && EOF != ( c = fgetc( f ) ))
    {
        if (c == '\t')
        {
            c = '\n';
        }
        szLine[length++] = (char) c;
        if (c == '\n')
        {
            break;
        }
    }
    if (!length && EOF == c)
    {
        return NULL;
    }
    szLine[length] = '\0';

    return szLine;
}
/****************************************************************************
    Read up to tab or LF but not more than len chars;
    if empty line, read further until a non-empty line;
    remove leading and trailing white spaces;
    keep zero termination
****************************************************************************/
Read up to tab or LF but not more than len chars;
if empty line, read further until a non-empty line;
remove leading and trailing white spaces;
keep zero termination
Read up to tab or LF but not more than len chars ; if empty line read further until a non - empty line ; remove leading and trailing white spaces ; keep zero termination
char *inchi_fgetsTab( char *szLine, int len, FILE *f )
{
    int  length = 0, c = 0;
    len--;
    while (length < len && EOF != ( c = fgetc( f ) ))
    {
        if (c == '\t')
        {
            c = '\n';
        }
        szLine[length++] = (char) c;
        if (c == '\n')
        {
            break;
        }
    }
    if (!length && EOF == c)
    {
        return NULL;
    }
    szLine[length] = '\0';
    return szLine;
}
char * inchi_fgetsTab ( char * szLine , int len , FILE * f ) { int length = 0 , c = 0 ; len -- ; while ( length < len && EOF != ( c = fgetc ( f ) ) ) { if ( c == ' \t ' ) { c = ' \n ' ; } szLine [ length ++ ] = ( char ) c ; if ( c == ' \n ' ) { break ; } } if ( ! length && EOF == c ) { return NULL ; } szLine [ length ] = ' \0 ' ; return szLine ; }
Read up to tab or LF but not more than len chars;
if empty line, read further until a non-empty line;
remove leading and trailing white spaces;
keep zero termination
Read up to tab or LF but not more than len chars ; if empty line read further until a non - empty line ; remove leading and trailing white spaces ; keep zero termination