[libvirt] [PATCH] Use standard spacing for user/pass prompt

Kind of minor, but it annoys me that the default auth callback doesn't put a space between the prompt and the input, like a typical terminal, ssh, etc. This patch changes the current prompt: Please enter your authentication name:myuser to Please enter your authentication name: myuser Signed-off-by: Cole Robinson <crobinso@redhat.com> --- src/libvirt.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/libvirt.c b/src/libvirt.c index be17668..9d50c92 100644 --- a/src/libvirt.c +++ b/src/libvirt.c @@ -159,7 +159,7 @@ static int virConnectAuthCallbackDefault(virConnectCredentialPtr cred, case VIR_CRED_AUTHNAME: case VIR_CRED_ECHOPROMPT: case VIR_CRED_REALM: - if (printf("%s:", cred[i].prompt) < 0) + if (printf("%s: ", cred[i].prompt) < 0) return -1; if (fflush(stdout) != 0) return -1; @@ -178,7 +178,7 @@ static int virConnectAuthCallbackDefault(virConnectCredentialPtr cred, case VIR_CRED_PASSPHRASE: case VIR_CRED_NOECHOPROMPT: - if (printf("%s:", cred[i].prompt) < 0) + if (printf("%s: ", cred[i].prompt) < 0) return -1; if (fflush(stdout) != 0) return -1; -- 1.6.5.2

According to Cole Robinson on 2/24/2010 12:23 PM:
Kind of minor, but it annoys me that the default auth callback doesn't put a space between the prompt and the input, like a typical terminal, ssh, etc. This patch changes the current prompt:
Please enter your authentication name:myuser
to
Please enter your authentication name: myuser
Agreed.
case VIR_CRED_REALM: - if (printf("%s:", cred[i].prompt) < 0) + if (printf("%s: ", cred[i].prompt) < 0)
ACK. But unrelated to your patch, how does this work with i18n? Obviously, translating "%s: " is useless. Is cred[i].prompt previously translated somewhere earlier in the caller? I ask, because I'm not sure whether all locales are okay with ': ' as the prompt tail, and wonder whether it should be inlined into the translated prompt, which in turn would simplify this part to puts(cred[i].prompt). -- Eric Blake eblake@redhat.com +1-801-349-2682 Libvirt virtualization library http://libvirt.org
participants (2)
-
Cole Robinson
-
Eric Blake