]> git.ipfire.org Git - thirdparty/util-linux.git/commit
chfn: Make readline prompt for each field on a separate line
authorDamien Goutte-Gattat <dgouttegattat@incenp.org>
Sat, 27 Jun 2020 18:58:13 +0000 (19:58 +0100)
committerKarel Zak <kzak@redhat.com>
Mon, 29 Jun 2020 09:57:26 +0000 (11:57 +0200)
commit49848aa53ae3a599277e8ceb50feda565f140b45
treef0f6c5f8d258856567cd23c623f6a955f9f7c9e6
parentfe0d12d4f82269096f8d0cffc51ca9590814c284
chfn: Make readline prompt for each field on a separate line

When readline is called to get user input, it is called without
a prompt argument. As a result, if the user does not enter anything
for a given field, then the next field is displayed on the same
line, yielding the following output:

  $ chfn
  Changing finger information for user.
  Password:
  Name []: Office []: Office Phone []: Home Phone []:

instead of the expected:

  $ chfn
  Changing finger information for user.
  Password:
  Full Name []:
  Room Number []:
  Work Phone []:
  Home Phone []:

This patch restores the expected behavior by feeding readline with
a character to display as "prompt".

[kzak@redhat.com: - do the same change in chsh
                  - use ' ' rather than '\n' for non-readline code]

Signed-off-by: Damien Goutte-Gattat <dgouttegattat@incenp.org>
Signed-off-by: Karel Zak <kzak@redhat.com>
login-utils/chfn.c
login-utils/chsh.c