--- tnftp-20070806/src/cmds.c +++ tnftp-20070806/src/cmds.c @@ -186,7 +186,7 @@ while (1) { fprintf(ttyout, "%s %s [anpqy?]? ", promptleft, promptright); (void)fflush(ttyout); - if (getline(stdin, line, sizeof(line), &errormsg) < 0) { + if (ftp_getline(stdin, line, sizeof(line), &errormsg) < 0) { mflag = 0; fprintf(ttyout, "%s; %s aborted\n", errormsg, cmd); return (0); @@ -781,7 +781,7 @@ argv[0] = "get"; mode = restart_point ? "r+" : "w"; - while (getline(fp, buf, sizeof(buf), NULL) >= 0) { + while (ftp_getline(fp, buf, sizeof(buf), NULL) >= 0) { if (buf[0] == '\0') continue; argv[1] = buf; --- tnftp-20070806/src/extern.h +++ tnftp-20070806/src/extern.h @@ -142,7 +142,7 @@ void get(int, char **); struct cmd *getcmd(const char *); int getit(int, char **, int, const char *); -int getline(FILE *, char *, size_t, const char **); +int ftp_getline(FILE *, char *, size_t, const char **); struct option *getoption(const char *); char *getoptionvalue(const char *); void getremoteinfo(void); --- tnftp-20070806/src/fetch.c +++ tnftp-20070806/src/fetch.c @@ -199,7 +199,7 @@ fprintf(ttyout, "%s\n", user); } else { (void)fflush(ttyout); - if (getline(stdin, user, sizeof(user), &errormsg) < 0) { + if (ftp_getline(stdin, user, sizeof(user), &errormsg) < 0) { warnx("%s; can't authenticate", errormsg); goto cleanup_auth_url; } @@ -839,7 +839,7 @@ } /* Read the response */ - len = getline(fin, buf, sizeof(buf), &errormsg); + len = ftp_getline(fin, buf, sizeof(buf), &errormsg); if (len < 0) { if (*errormsg == '\n') errormsg++; @@ -863,7 +863,7 @@ /* Read the rest of the header. */ while (1) { - len = getline(fin, buf, sizeof(buf), &errormsg); + len = ftp_getline(fin, buf, sizeof(buf), &errormsg); if (len < 0) { if (*errormsg == '\n') errormsg++; @@ -1067,7 +1067,7 @@ fprintf(ttyout, "Authorization failed. Retry (y/n)? "); - if (getline(stdin, reply, sizeof(reply), NULL) + if (ftp_getline(stdin, reply, sizeof(reply), NULL) < 0) { goto cleanup_fetch_url; } --- tnftp-20070806/src/main.c +++ tnftp-20070806/src/main.c @@ -675,7 +675,7 @@ fprintf(ttyout, "%s ", p); } (void)fflush(ttyout); - num = getline(stdin, line, sizeof(line), NULL); + num = ftp_getline(stdin, line, sizeof(line), NULL); switch (num) { case -1: /* EOF */ case -2: /* error */ --- tnftp-20070806/src/util.c +++ tnftp-20070806/src/util.c @@ -422,7 +422,7 @@ else fprintf(ttyout, "Name (%s): ", host); errormsg = NULL; - nlen = getline(stdin, tmp, sizeof(tmp), &errormsg); + nlen = ftp_getline(stdin, tmp, sizeof(tmp), &errormsg); if (nlen < 0) { fprintf(ttyout, "%s; %s aborted.\n", errormsg, "login"); code = -1; @@ -530,7 +530,7 @@ fprintf(ttyout, "(%s) ", prompt); line[len++] = ' '; errormsg = NULL; - nlen = getline(stdin, line + len, sizeof(line)-len, &errormsg); + nlen = ftp_getline(stdin, line + len, sizeof(line)-len, &errormsg); if (nlen < 0) { fprintf(ttyout, "%s; %s aborted.\n", errormsg, "operation"); intr(0); @@ -1295,7 +1295,7 @@ * -3 line was too long */ int -getline(FILE *stream, char *buf, size_t buflen, const char **errormsg) +ftp_getline(FILE *stream, char *buf, size_t buflen, const char **errormsg) { int rv, ch; size_t len;