]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
chfn: disable tab completion
authorSami Kerola <kerolasa@iki.fi>
Thu, 18 May 2017 21:19:35 +0000 (22:19 +0100)
committerKarel Zak <kzak@redhat.com>
Fri, 19 May 2017 09:43:34 +0000 (11:43 +0200)
The default readline tab completion that offers file listing from current
directory does not make any sense in this context.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
login-utils/chfn.c

index d79a192cfc719c8e9ce2c45ad487d651d7297f3f..3a951a1935b1e135a45afc4c9c97a5dd104982d0 100644 (file)
@@ -237,6 +237,7 @@ static char *ask_new_field(struct chfn_control *ctl, const char *question,
                printf("%s [%s]: ", question, def_val);
                __fpurge(stdin);
 #ifdef HAVE_LIBREADLINE
+               rl_bind_key('\t', rl_insert);
                if ((buf = readline(NULL)) == NULL)
 #else
                if (getline(&buf, &dummy, stdin) < 0)