Cleanup and added funny joke haha
[citadel.git] / ctdlsh / src / passwd.c
index 65ae280e9097662c38f38cc321219a3eae14204d..2b914abb205062d5ad8b420dfdfe265aba7b8f0d 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * (c) 2009-2011 by Art Cancro and citadel.org
+ * (c) 2009-2012 by Art Cancro and citadel.org
  * This program is released under the terms of the GNU General Public License v3.
  */
 
@@ -13,6 +13,9 @@ int cmd_passwd(int server_socket, char *cmdbuf) {
        char *p2;
 
        strcpy(account_name, &cmdbuf[7]);
+       if (strlen(account_name) == 0) {
+               strncpy(account_name, readline("Enter account name: "), sizeof account_name);
+       }
        sock_printf(server_socket, "AGUP %s\n", account_name);
        sock_getln(server_socket, buf, sizeof buf);
        if (buf[0] != '2') {
@@ -24,7 +27,9 @@ int cmd_passwd(int server_socket, char *cmdbuf) {
        p2 = readline("Enter it again: ");
 
        if (strcmp(p1, p2)) {
-               fprintf(stderr, "Passwords do not match.  Account password is unchanged.\n");
+               fprintf(stderr, "The passwords you entered do not match."
+                               "The account password remains unchanged.\n"
+               );
                return(cmdret_error);
        }