*** htpasswd.c.orig	Sun Feb 25 16:27:08 2001
--- htpasswd.c	Sat Jul 14 13:08:18 2001
***************
*** 92,97 ****
--- 92,98 ----
  #endif
  
  #include "apr_md5.h"
+ #include "apr_crypt.h"
  #include "apr_sha1.h"
  #include <time.h>
  
***************
*** 258,263 ****
--- 259,274 ----
  
  	apr_cpystrn(cpw, (char *)crypt(pw, salt), sizeof(cpw) - 1);
  	break;
+ #else
+     case ALG_CRYPT:
+     default:
+         (void) srand((int) time((time_t *) NULL));
+         to64(&salt[0], rand(), 8);
+         salt[8] = '\0';
+ 
+ 	apr_cpystrn(cpw, (char *)apr_crypt(pw, salt), sizeof(cpw) - 1);
+ 	break;
+ 
  #endif
      }
      memset(pw, '\0', strlen(pw));
***************
*** 511,523 ****
  	}
  	strcpy(password, argv[i + 2]);
      }
- 
- #ifdef WIN32
-     if (alg == ALG_CRYPT) {
- 	alg = ALG_APMD5;
- 	fprintf(stderr, "Automatically using MD5 format on Windows.\n");
-     }
- #endif
  
  #if (!(defined(WIN32) || defined(TPF)))
      if (alg == ALG_PLAIN) {
--- 522,527 ----
