]> git.pld-linux.org Git - packages/ftp.git/blobdiff - netkit-ftp-input_line.patch
- netkit-ftp-input_line.patch: fix behavior when the line entered is
[packages/ftp.git] / netkit-ftp-input_line.patch
diff --git a/netkit-ftp-input_line.patch b/netkit-ftp-input_line.patch
new file mode 100644 (file)
index 0000000..e95d7a2
--- /dev/null
@@ -0,0 +1,28 @@
+--- netkit-ftp-0.17/ftp/main.c~        Wed Nov 28 18:50:24 2001
++++ netkit-ftp-0.17/ftp/main.c Wed Nov 28 18:53:14 2001
+@@ -324,16 +324,19 @@
+               l = strlen(line);
+               if (l == 0)
+                       break;
+-              if (line[--l] == '\n') {
+-                      if (l == 0)
+-                              break;
+-                      line[l] = '\0';
+-              } 
+-              else if (l == sizeof(line) - 2) {
++              if (l == sizeof(line) - 1) {
+                       printf("sorry, input line too long\n");
++#ifdef __USE_READLINE__
++                      if (!(fromatty && !rl_inhibit))
++#endif
+                       while ((l = getchar()) != '\n' && l != EOF)
+                               /* void */;
+                       break;
++              }
++              if (line[--l] == '\n') {
++                      if (l == 0)
++                              break;
++                      line[l] = '\0';
+               } /* else it was a line without a newline */
+               margv = makeargv(&margc, &marg);
+               if (margc == 0) {
This page took 0.095686 seconds and 4 git commands to generate.