From: Jeff Trawick Date: Fri, 10 May 2002 18:20:29 +0000 (+0000) Subject: avoid colliding with getline() as defined by glibc X-Git-Tag: 2.0.37~434 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=0f0550b08c593df5b8b0ab7fb81e4deb6ce1a6b7;p=apache avoid colliding with getline() as defined by glibc (it breaks if you need to turn on _GNU_SOURCE) git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@95035 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/support/htdigest.c b/support/htdigest.c index c65a243a3b..7f41bfcd23 100644 --- a/support/htdigest.c +++ b/support/htdigest.c @@ -118,7 +118,7 @@ static void getword(char *word, char *line, char stop) while ((line[y++] = line[x++])); } -static int getline(char *s, int n, apr_file_t *f) +static int get_line(char *s, int n, apr_file_t *f) { register int i = 0; char ch; @@ -277,7 +277,7 @@ int main(int argc, const char * const argv[]) strcpy(realm, argv[2]); found = 0; - while (!(getline(line, MAX_STRING_LEN, f))) { + while (!(get_line(line, MAX_STRING_LEN, f))) { if (found || (line[0] == '#') || (!line[0])) { putline(tfp, line); continue; diff --git a/support/htpasswd.c b/support/htpasswd.c index 93f8400e48..064b925020 100644 --- a/support/htpasswd.c +++ b/support/htpasswd.c @@ -154,7 +154,7 @@ static char *tname_buf = NULL; * Get a line of input from the user, not including any terminating * newline. */ -static int getline(char *s, int n, FILE *f) +static int get_line(char *s, int n, FILE *f) { register int i = 0; @@ -633,7 +633,7 @@ int main(int argc, const char * const argv[]) char scratch[MAX_STRING_LEN]; fpw = fopen(pwfilename, "r"); - while (! (getline(line, sizeof(line), fpw))) { + while (! (get_line(line, sizeof(line), fpw))) { char *colon; if ((line[0] == '#') || (line[0] == '\0')) { diff --git a/support/logresolve.c b/support/logresolve.c index 197181449a..31dc609fda 100644 --- a/support/logresolve.c +++ b/support/logresolve.c @@ -66,7 +66,7 @@ #endif static void cgethost(struct in_addr ipnum, char *string, int check); -static int getline(char *s, int n); +static int get_line(char *s, int n); static void stats(FILE *output); #ifdef BEOS @@ -282,7 +282,7 @@ static void stats (FILE *output) * gets a line from stdin */ -static int getline (char *s, int n) +static int get_line (char *s, int n) { char *cp; @@ -332,7 +332,7 @@ int main (int argc, char *argv[]) for (i = 0; i < MAX_ERR + 2; i++) errors[i] = 0; - while (getline(line, MAXLINE)) { + while (get_line(line, MAXLINE)) { if (line[0] == '\0') continue; entries++;