[pacman-dev] [PATCH] 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
participants (1)
-
Dave Reisner