Exit when no email/password was entered or ^C was pressed
(upstream git commit 18f39b5ac22fe0ab85203f7a471f511d2bf96e28)
This commit is contained in:
parent
581f550f46
commit
06161dac2b
@ -1,9 +1,9 @@
|
||||
# $OpenBSD: Makefile,v 1.80 2016/11/05 21:27:26 dcoppa Exp $
|
||||
# $OpenBSD: Makefile,v 1.81 2016/12/05 10:33:30 dcoppa Exp $
|
||||
|
||||
COMMENT = command-line client for Pandora Internet Radio
|
||||
|
||||
DISTNAME = pianobar-2016.06.02
|
||||
REVISION = 2
|
||||
REVISION = 3
|
||||
EXTRACT_SUFX = .tar.bz2
|
||||
CATEGORIES = audio
|
||||
|
||||
|
33
audio/pianobar/patches/patch-src_main_c
Normal file
33
audio/pianobar/patches/patch-src_main_c
Normal file
@ -0,0 +1,33 @@
|
||||
$OpenBSD: patch-src_main_c,v 1.21 2016/12/05 10:33:30 dcoppa Exp $
|
||||
|
||||
commit 18f39b5ac22fe0ab85203f7a471f511d2bf96e28
|
||||
Author: Lars-Dominik Braun <lars@6xq.net>
|
||||
Date: Fri Dec 2 15:03:10 2016 +0100
|
||||
|
||||
Exit when no email/password was entered or ^C was pressed
|
||||
|
||||
--- src/main.c.orig Thu Jun 2 08:49:26 2016
|
||||
+++ src/main.c Mon Dec 5 11:28:33 2016
|
||||
@@ -86,7 +86,9 @@ static bool BarMainGetLoginCredentials (BarSettings_t
|
||||
char nameBuf[100];
|
||||
|
||||
BarUiMsg (settings, MSG_QUESTION, "Email: ");
|
||||
- BarReadlineStr (nameBuf, sizeof (nameBuf), input, BAR_RL_DEFAULT);
|
||||
+ if (BarReadlineStr (nameBuf, sizeof (nameBuf), input, BAR_RL_DEFAULT) == 0) {
|
||||
+ return false;
|
||||
+ }
|
||||
settings->username = strdup (nameBuf);
|
||||
usernameFromConfig = false;
|
||||
}
|
||||
@@ -100,7 +102,10 @@ static bool BarMainGetLoginCredentials (BarSettings_t
|
||||
|
||||
if (settings->passwordCmd == NULL) {
|
||||
BarUiMsg (settings, MSG_QUESTION, "Password: ");
|
||||
- BarReadlineStr (passBuf, sizeof (passBuf), input, BAR_RL_NOECHO);
|
||||
+ if (BarReadlineStr (passBuf, sizeof (passBuf), input, BAR_RL_NOECHO) == 0) {
|
||||
+ puts ("");
|
||||
+ return false;
|
||||
+ }
|
||||
/* write missing newline */
|
||||
puts ("");
|
||||
settings->password = strdup (passBuf);
|
Loading…
x
Reference in New Issue
Block a user