[mw-devel] MW3 r1089 - trunk/src
welshbyte at sucs.org
welshbyte at sucs.org
Fri Oct 9 21:53:46 BST 2009
Author: welshbyte
Date: 2009-10-09 21:53:46 +0100 (Fri, 09 Oct 2009)
New Revision: 1089
Modified:
trunk/src/user.c
Log:
- Remind the user what their default username is on login/signup
- Add "y/n" to the "Did I get your name right?" prompt
- Correct a typo
- Remove a bit of old commented-out code
Modified: trunk/src/user.c
===================================================================
--- trunk/src/user.c 2009-07-29 16:20:10 UTC (rev 1088)
+++ trunk/src/user.c 2009-10-09 20:53:46 UTC (rev 1089)
@@ -78,12 +78,12 @@
void get_login(char *name, int autochat)
{
- char *lname;
+ char *lname = getmylogin();
fflush(stdin);
gstart: if (autochat)
name[0]=0;
else {
- printf(_("Please enter username: "));
+ printf(_("Please enter username [%s]: "), lname);
get_str(name,NAMESIZE);
}
strip_name(name);
@@ -93,7 +93,6 @@
SAFE_FREE(fold);
exit(0);
}
- lname=(char *)getmylogin();
if (strlen(name)<1)
{
if (lname==NULL)
@@ -104,9 +103,6 @@
{
strncpy(name,lname,NAMESIZE);
name[NAMESIZE]=0;
- /* eh? if (stringcmp(name,"guest",-1))
- strcpy(name,getenv("UNAM"));
- */
}
}
}
@@ -193,7 +189,7 @@
char passwd[PASSWDSIZE],passwd2[PASSWDSIZE],salt[3];
char c[10];
do{
- printf(_("Did I get your name right %s ?"),name);
+ printf(_("Did I get your name right %s ? y/n: "),name);
get_str(c,9);
}while (!*c);
if(*c=='y' || *c=='Y')
@@ -214,7 +210,7 @@
do{
if (diff) printf(_("Passwords did not match.\n"));
strcpy(passwd,crypt(get_pass(_("Enter password: ")),salt));
- strcpy(passwd2,crypt(get_pass(_("Re-enter passwd: ")),salt));
+ strcpy(passwd2,crypt(get_pass(_("Re-enter password: ")),salt));
}while ((diff=strcmp(passwd,passwd2)));
strncpy(usr->passwd,passwd,PASSWDSIZE);
strncpy(usr->name,name,NAMESIZE);
More information about the mw-devel
mailing list