[3111] in Athena Bugs
(RTPC) Version 6.3B: chfn
daemon@ATHENA.MIT.EDU (Jonathan I. Kamens)
Wed Sep 6 16:41:13 1989
Date: Wed, 6 Sep 89 16:40:49 -0400
From: Jonathan I. Kamens <jik@ATHENA.MIT.EDU>
To: bugs@ATHENA.MIT.EDU
System type, version: (RTPC) Version 6.3B
System name: vulcan
What's wrong:
The procedure "ask" in ~source/third_party/sms/clients/passwd/chfn.c
is supposed to allow "none" as a valid response for any field, but it
is broken and therefore doesn't allow "none" for phone number fields.
The patch below will fix this problem.
*** chfn.c.orig Wed Sep 6 14:03:52 1989
--- chfn.c Wed Sep 6 14:04:22 1989
***************
*** 258,265 ****
buf[strlen(buf) - 1] = NULL;
if (strlen(buf) == 0)
result = def_val;
! else if (strcasecmp(buf, BLANK) == NULL)
result = "";
else
result = buf;
--- 258,267 ----
buf[strlen(buf) - 1] = NULL;
if (strlen(buf) == 0)
result = def_val;
! else if (strcasecmp(buf, BLANK) == NULL) {
result = "";
+ goto done;
+ }
else
result = buf;
***************
*** 304,310 ****
}
/* Remove dashes if necessary */
! if (dashes && result == buf) {
char *tmp1, *tmp2;
tmp1 = tmp2 = (char *)buf;
do {
--- 306,312 ----
}
/* Remove dashes if necessary */
! if (dashes) {
char *tmp1, *tmp2;
tmp1 = tmp2 = (char *)buf;
do {
***************
*** 313,319 ****
}
while (*(tmp1++));
}
!
return(result);
}
--- 315,322 ----
}
while (*(tmp1++));
}
!
! done:
return(result);
}