--- tnftp-20090520/src/cmds.c +++ tnftp-20090520/src/cmds.c @@ -181,7 +181,7 @@ while (1) { fprintf(ttyout, "%s %s [anpqy?]? ", promptleft, promptright); (void)fflush(ttyout); - if (getline(stdin, cline, sizeof(cline), &errormsg) < 0) { + if (ftp_getline(stdin, cline, sizeof(cline), &errormsg) < 0) { mflag = 0; fprintf(ttyout, "%s; %s aborted\n", errormsg, cmd); return (0); @@ -776,7 +776,7 @@ argv[0] = cmdbuf; gmode = 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-20090520/src/extern.h +++ tnftp-20090520/src/extern.h @@ -135,7 +135,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-20090520/src/fetch.c +++ tnftp-20090520/src/fetch.c @@ -193,7 +193,7 @@ fprintf(ttyout, "%s\n", uuser); } else { (void)fflush(ttyout); - if (getline(stdin, uuser, sizeof(uuser), &errormsg) < 0) { + if (ftp_getline(stdin, uuser, sizeof(uuser), &errormsg) < 0) { warnx("%s; can't authenticate", errormsg); goto cleanup_auth_url; } @@ -841,7 +841,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++; @@ -865,7 +865,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++; @@ -1070,7 +1070,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-20090520/src/main.c +++ tnftp-20090520/src/main.c @@ -682,7 +682,7 @@ fprintf(ttyout, "%s ", p); } (void)fflush(ttyout); - len = getline(stdin, line, sizeof(line), NULL); + len = ftp_getline(stdin, line, sizeof(line), NULL); switch (len) { case -1: /* EOF */ case -2: /* error */ --- tnftp-20090520/src/util.c +++ tnftp-20090520/src/util.c @@ -415,7 +415,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; @@ -523,7 +523,7 @@ fprintf(ttyout, "(%s) ", aprompt); 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); @@ -1255,7 +1255,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;