From 85263c3061a4d086c9ab92b67238477cae15584f Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Thu, 15 Sep 2005 20:03:35 +0000 Subject: r10246: Remove unused function Move auth-specific file to auth/ (This used to be commit 8aa9711a306b30da905f53148ebe352462852d74) --- source4/lib/util_file.c | 90 +------------------------------------------------ 1 file changed, 1 insertion(+), 89 deletions(-) (limited to 'source4/lib/util_file.c') diff --git a/source4/lib/util_file.c b/source4/lib/util_file.c index 338b9547a5..156d09aaf5 100644 --- a/source4/lib/util_file.c +++ b/source4/lib/util_file.c @@ -22,94 +22,6 @@ #include "system/shmem.h" #include "system/filesys.h" -/************************************************************************* - gets a line out of a file. - line is of format "xxxx:xxxxxx:xxxxx:". - lines with "#" at the front are ignored. -*************************************************************************/ -int getfileline(void *vp, char *linebuf, int linebuf_size) -{ - /* Static buffers we will return. */ - FILE *fp = (FILE *)vp; - uint8_t c; - uint8_t *p; - size_t linebuf_len; - - if (fp == NULL) - { - DEBUG(0,("getfileline: Bad file pointer.\n")); - return -1; - } - - /* - * Scan the file, a line at a time. - */ - while (!feof(fp)) - { - linebuf[0] = '\0'; - - fgets(linebuf, linebuf_size, fp); - if (ferror(fp)) - { - return -1; - } - - /* - * Check if the string is terminated with a newline - if not - * then we must keep reading and discard until we get one. - */ - - linebuf_len = strlen(linebuf); - if (linebuf_len == 0) - { - linebuf[0] = '\0'; - return 0; - } - - if (linebuf[linebuf_len - 1] != '\n') - { - c = '\0'; - while (!ferror(fp) && !feof(fp)) - { - c = fgetc(fp); - if (c == '\n') - { - break; - } - } - } - else - { - linebuf[linebuf_len - 1] = '\0'; - } - -#ifdef DEBUG_PASSWORD - DEBUG(100, ("getfileline: got line |%s|\n", linebuf)); -#endif - if ((linebuf[0] == 0) && feof(fp)) - { - DEBUG(4, ("getfileline: end of file reached\n")); - return 0; - } - - if (linebuf[0] == '#' || linebuf[0] == '\0') - { - DEBUG(6, ("getfileline: skipping comment or blank line\n")); - continue; - } - - p = (uint8_t *) strchr_m(linebuf, ':'); - if (p == NULL) - { - DEBUG(0, ("getfileline: malformed line entry (no :)\n")); - continue; - } - return linebuf_len; - } - return -1; -} - - /**************************************************************************** read a line from a file with possible \ continuation chars. Blanks at the start or end of a line are stripped. @@ -350,7 +262,7 @@ char **fd_lines_load(int fd, int *numlines, TALLOC_CTX *mem_ctx) /**************************************************************************** -take a lislist of lines and modify them to produce a list where \ continues +take a list of lines and modify them to produce a list where \ continues a line ****************************************************************************/ void file_lines_slashcont(char **lines) -- cgit