int vfs_fgets ( char *  str,
size_t  size,
FILE *  fp 
)

fgets()-like routine that performs newline-stripping.

Definition at line 475 of file vfs.c.

00476 {
00477         char *eol;
00478 
00479         if (fgets(str, size, fp) == NULL)
00480                 return (-1);
00481         
00482         eol = strchr(str, '\0');
00483         g_assert(eol != NULL);
00484 
00485         /* Strip the final \n */
00486         if (--eol >= str && *eol == '\n') {
00487                 *eol = '\0';
00488                 /* Strip the final \r */
00489                 if (--eol >= str && *eol == '\r')
00490                         *eol = '\0';
00491         }
00492 
00493         return (0);
00494 }

Here is the caller graph for this function:

 All Data Structures Files Functions Variables Defines
Generated on Mon Mar 15 04:45:49 2010 for herrie by  doxygen 1.6.3