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 03-16-2011, 08:24 PM
Dave Reisner
 
Default Only read from stdin if sole target is '-'

This prevents a regression for people who enjoy piping yes to pacman to
avoid prompts.

Signed-off-by: Dave Reisner <d@falconindy.com>
---
src/pacman/pacman.c | 5 +++--
1 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/src/pacman/pacman.c b/src/pacman/pacman.c
index 984bd1b..c66d34b 100644
--- a/src/pacman/pacman.c
+++ b/src/pacman/pacman.c
@@ -1361,8 +1361,9 @@ int main(int argc, char *argv[])
cleanup(ret);
}

- /* we also support reading targets from stdin */
- if(!isatty(fileno(stdin))) {
+ /* we support reading targets from stdin if the only arg is '-' */
+ if(!isatty(fileno(stdin) && alpm_list_count(pm_targets) == 1 &&
+ strcmp(alpm_list_getdata(pm_targets), "-") == 0)) {
char line[PATH_MAX];
int i = 0;
while(i < PATH_MAX && (line[i] = (char)fgetc(stdin)) != EOF) {
--
1.7.4.1
 

Thread Tools




All times are GMT. The time now is 12:24 AM.

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