From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 2155) id 7A1403987C36; Thu, 20 May 2021 20:40:05 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 7A1403987C36 Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: Corinna Vinschen To: cygwin-cvs@sourceware.org Subject: [newlib-cygwin] Cygwin: utils: chattr: do not default to CWD X-Act-Checkin: newlib-cygwin X-Git-Author: Corinna Vinschen X-Git-Refname: refs/heads/master X-Git-Oldrev: f8eecf22db118347da55c25c4f75890b9902fabc X-Git-Newrev: 3053632389c506143080b6ed5d559aaa1d6de114 Message-Id: <20210520204005.7A1403987C36@sourceware.org> Date: Thu, 20 May 2021 20:40:05 +0000 (GMT) X-BeenThere: cygwin-cvs@cygwin.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Cygwin core component git logs List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 20 May 2021 20:40:05 -0000 https://sourceware.org/git/gitweb.cgi?p=newlib-cygwin.git;h=3053632389c506143080b6ed5d559aaa1d6de114 commit 3053632389c506143080b6ed5d559aaa1d6de114 Author: Corinna Vinschen Date: Thu May 20 22:39:22 2021 +0200 Cygwin: utils: chattr: do not default to CWD Drop the unexpected behaviour to run chattr in the CWD if no file has been specified on the command line. Bail out with usage info instead. Signed-off-by: Corinna Vinschen Diff: --- winsup/utils/chattr.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/winsup/utils/chattr.c b/winsup/utils/chattr.c index eb60e5d3e..6942e11b0 100644 --- a/winsup/utils/chattr.c +++ b/winsup/utils/chattr.c @@ -320,12 +320,9 @@ next: if (sanity_check ()) return 1; if (optind > argc - 1) - { - chattr ("."); - if (Ropt) - chattr_dir ("."); - } - else for (; optind < argc; ++optind) + usage (stderr); + + for (; optind < argc; ++optind) { struct stat st;