]> git.pld-linux.org Git - packages/ftp.git/blob - netkit-ftp-input_line.patch
- added desktop file and png icon (based on lftp icon).
[packages/ftp.git] / netkit-ftp-input_line.patch
1 --- netkit-ftp-0.17/ftp/main.c~ Wed Nov 28 18:50:24 2001
2 +++ netkit-ftp-0.17/ftp/main.c  Wed Nov 28 18:53:14 2001
3 @@ -324,16 +324,19 @@
4                 l = strlen(line);
5                 if (l == 0)
6                         break;
7 -               if (line[--l] == '\n') {
8 -                       if (l == 0)
9 -                               break;
10 -                       line[l] = '\0';
11 -               } 
12 -               else if (l == sizeof(line) - 2) {
13 +               if (l == sizeof(line) - 1) {
14                         printf("sorry, input line too long\n");
15 +#ifdef __USE_READLINE__
16 +                       if (!(fromatty && !rl_inhibit))
17 +#endif
18                         while ((l = getchar()) != '\n' && l != EOF)
19                                 /* void */;
20                         break;
21 +               }
22 +               if (line[--l] == '\n') {
23 +                       if (l == 0)
24 +                               break;
25 +                       line[l] = '\0';
26                 } /* else it was a line without a newline */
27                 margv = makeargv(&margc, &marg);
28                 if (margc == 0) {
This page took 0.051308 seconds and 3 git commands to generate.