--- orig\getpass.c      Thu Oct 26 11:01:40 2000
+++ getpass.c   Thu Oct 26 11:23:58 2000
@@ -45,8 +45,6 @@
 #  endif
 #endif

-#define INPUT_BUFFER 128
-
 #ifndef RETSIGTYPE
 #  define RETSIGTYPE void
 #endif
@@ -70,11 +68,10 @@
 #  define perror(x) fprintf(stderr, "Error in: %s\n", x)
 #endif

-char *getpass(const char *prompt)
+void getpass(const char *prompt, char *buffer, int buflen)
 {
   FILE *infp;
   FILE *outfp;
-  static char buf[INPUT_BUFFER];
   RETSIGTYPE (*sigint)();
 #ifndef __EMX__
   RETSIGTYPE (*sigtstp)();
@@ -142,8 +139,8 @@
   fputs(prompt, outfp);
   fflush(outfp);

-  bytes_read=read(infd, buf, INPUT_BUFFER);
-  buf[bytes_read > 0 ? (bytes_read -1) : 0] = '\0';
+  bytes_read=read(infd, buffer, buflen);
+  buffer[bytes_read > 0 ? (bytes_read -1) : 0] = '\0';

   /* print a new line if needed */
 #ifdef HAVE_TERMIOS_H
@@ -157,7 +154,7 @@

   /*
    * reset term charectaristics, use TCSAFLUSH incase the
-   * user types more than INPUT_BUFFER
+   * user types more than buflen
    */
 #ifdef HAVE_TERMIOS_H
   if(tcsetattr(outfd, TCSAFLUSH, &orig) != 0)
@@ -178,16 +175,26 @@
 #ifndef __EMX__
   signal(SIGTSTP, sigtstp);
 #endif
-
-  return(buf);
 }
-#else
+#else /* WIN32 */
 #include <stdio.h>
-char *getpass(const char *prompt)
+#include <conio.h>
+void getpass(const char *prompt, char *buffer, int buflen)
 {
-       static char password[80];
+    int i;
        printf(prompt);
-       gets(password);
-       return password;
+
+    for(i=0; i<buflen; i++)
+    {
+        buffer[i] = getch();
+        if ( buffer[i] == '\r' )
+        {
+            buffer[i] = 0;
+            break;
+        }
+    }
+    /* if user didn't hit ENTER, terminate buffer */
+    if (i==buflen)
+        buffer[buflen-1]=0;
 }
-#endif /* don't do anything if WIN32 */
+#endif
--- orig\getpass.h      Thu Oct 26 11:01:40 2000
+++ getpass.h   Thu Oct 26 11:13:27 2000
@@ -1 +1 @@
-char *getpass(const char *prompt);
+void getpass(const char *prompt, char* buffer, int buflen );
--- orig\url.c  Thu Oct 26 11:01:42 2000
+++ url.c       Thu Oct 26 11:37:22 2000
@@ -789,7 +789,7 @@

     /* check for password, if no ask for one */
     if( !data->passwd[0] ) {
-      strncpy(data->passwd, getpass("password: "), sizeof(data->passwd));
+      getpass("password:",data->passwd,sizeof(data->passwd));
     }
   }

@@ -808,7 +808,7 @@

     /* check for password, if no ask for one */
     if( !data->proxypasswd[0] ) {
-      strncpy(data->proxypasswd, getpass("proxy password: "), sizeof(data->proxypasswd));
+      getpass("proxy password:",data->proxypasswd,sizeof(data->proxypasswd));
     }

   }
@@ -1117,7 +1117,7 @@

       /* check for password, if no ask for one */
       if( !data->passwd[0] ) {
-        strncpy(data->passwd, getpass("password: "), sizeof(data->passwd));
+        getpass("password:",data->passwd,sizeof(data->passwd));
       }

       conn->name = ++ptr;

