summaryrefslogtreecommitdiffstats
path: root/login-utils/chfn.c
diff options
context:
space:
mode:
authorSami Kerola2014-12-17 23:28:03 +0100
committerSami Kerola2014-12-19 10:11:04 +0100
commitd9e1ac99e420f2521849e336a4e57cce1b875241 (patch)
treeb90c50e12524981e2e25c6ba63118f53a0d08aab /login-utils/chfn.c
parentchfn: move new and old finger structs to chfn control struct (diff)
downloadkernel-qcow2-util-linux-d9e1ac99e420f2521849e336a4e57cce1b875241.tar.gz
kernel-qcow2-util-linux-d9e1ac99e420f2521849e336a4e57cce1b875241.tar.xz
kernel-qcow2-util-linux-d9e1ac99e420f2521849e336a4e57cce1b875241.zip
chfn: rename prompt() to ask_new_field()
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
Diffstat (limited to 'login-utils/chfn.c')
-rw-r--r--login-utils/chfn.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/login-utils/chfn.c b/login-utils/chfn.c
index f74ed228d..fabe308f9 100644
--- a/login-utils/chfn.c
+++ b/login-utils/chfn.c
@@ -202,10 +202,11 @@ static void parse_passwd(struct chfn_control *ctl)
}
/*
- * prompt () --
+ * ask_new_field () --
* ask the user for a given field and check that the string is legal.
*/
-static char *prompt(const char *question, char *def_val)
+static char *ask_new_field(struct chfn_control *ctl, const char *question,
+ char *def_val)
{
int len;
char *ans;
@@ -238,10 +239,10 @@ static char *prompt(const char *question, char *def_val)
*/
static void ask_info(struct chfn_control *ctl)
{
- ctl->newf.full_name = prompt(_("Name"), ctl->oldf.full_name);
- ctl->newf.office = prompt(_("Office"), ctl->oldf.office);
- ctl->newf.office_phone = prompt(_("Office Phone"), ctl->oldf.office_phone);
- ctl->newf.home_phone = prompt(_("Home Phone"), ctl->oldf.home_phone);
+ ctl->newf.full_name = ask_new_field(ctl, _("Name"), ctl->oldf.full_name);
+ ctl->newf.office = ask_new_field(ctl, _("Office"), ctl->oldf.office);
+ ctl->newf.office_phone = ask_new_field(ctl, _("Office Phone"), ctl->oldf.office_phone);
+ ctl->newf.home_phone = ask_new_field(ctl, _("Home Phone"), ctl->oldf.home_phone);
printf("\n");
}