FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > ArchLinux > ArchLinux Pacman Development

 
 
LinkBack Thread Tools
 
Old 01-12-2012, 12:10 PM
Olivier Brunel
 
Default Fix broken output when asking question and stdin is piped (FS#27909)

When asking question and stdin is piped, the response does not get printed out,
resulting in a missing
and broken output (FS#27909); printing the response
fixes it.

Signed-off-by: Olivier Brunel <i.am.jack.mail@gmail.com>
---
src/pacman/util.c | 7 +++++++
1 files changed, 7 insertions(+), 0 deletions(-)

diff --git a/src/pacman/util.c b/src/pacman/util.c
index 2d88bac..876a15b 100644
--- a/src/pacman/util.c
+++ b/src/pacman/util.c
@@ -1429,6 +1429,13 @@ static int question(short preset, char *fmt, va_list args)
if(len == 0) {
return preset;
}
+
+ /* if stdin is piped, response does not get printed out, and as a result
+ * a
is missing, resulting in broken output (FS#27909) */
+ struct stat sb;
+ if (fstat(STDIN_FILENO, &sb) == 0 && S_ISFIFO(sb.st_mode)) {
+ fprintf(stream, "%s
", response);
+ }

if(strcasecmp(response, _("Y")) == 0 || strcasecmp(response, _("YES")) == 0) {
return 1;
--
1.7.8.3
 

Thread Tools




All times are GMT. The time now is 01:03 PM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org