Date: Fri, 24 Aug 2012 21:45:53 +0000 (UTC) From: Baptiste Daroussin <bapt@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r239664 - head/usr.sbin/pkg Message-ID: <201208242145.q7OLjrqB010295@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: bapt Date: Fri Aug 24 21:45:52 2012 New Revision: 239664 URL: http://svn.freebsd.org/changeset/base/239664 Log: Fix confirmation logic when detecting a tty Reported by: mjg Modified: head/usr.sbin/pkg/pkg.c Modified: head/usr.sbin/pkg/pkg.c ============================================================================== --- head/usr.sbin/pkg/pkg.c Fri Aug 24 21:08:56 2012 (r239663) +++ head/usr.sbin/pkg/pkg.c Fri Aug 24 21:45:52 2012 (r239664) @@ -427,10 +427,10 @@ main(__unused int argc, char *argv[]) */ if (getenv("ASSUME_ALWAYS_YES") == NULL) { printf("%s", confirmation_message); - if (isatty(fileno(stdin)) && - pkg_query_yes_no() == 0) + if (!isatty(fileno(stdin))) exit(EXIT_FAILURE); - else + + if (pkg_query_yes_no() == 0) exit(EXIT_FAILURE); } if (bootstrap_pkg() != 0)
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201208242145.q7OLjrqB010295>