Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 26 Nov 2012 05:13:58 +0000 (UTC)
From:      Eitan Adler <eadler@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org
Subject:   svn commit: r243557 - stable/9/bin/mv
Message-ID:  <201211260513.qAQ5DwZV003048@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: eadler
Date: Mon Nov 26 05:13:57 2012
New Revision: 243557
URL: http://svnweb.freebsd.org/changeset/base/243557

Log:
  MFC r243072:
  Follow the behavior as specified in POSIX:
  
  	if (exists AND (NOT f_option) AND
  		((not_writable AND input_is_terminal) OR i_option))
  			prompt
  
  	in particular, add the test for input_is_terminal
  
  PR:		bin/173039
  Approved by:	cperciva (implicit)

Modified:
  stable/9/bin/mv/mv.c
Directory Properties:
  stable/9/bin/mv/   (props changed)

Modified: stable/9/bin/mv/mv.c
==============================================================================
--- stable/9/bin/mv/mv.c	Mon Nov 26 05:13:57 2012	(r243556)
+++ stable/9/bin/mv/mv.c	Mon Nov 26 05:13:57 2012	(r243557)
@@ -199,7 +199,7 @@ do_move(const char *from, const char *to
 		} else if (iflg) {
 			(void)fprintf(stderr, "overwrite %s? %s", to, YESNO);
 			ask = 1;
-		} else if (access(to, W_OK) && !stat(to, &sb)) {
+		} else if (access(to, W_OK) && !stat(to, &sb) && isatty(STDIN_FILENO)) {
 			strmode(sb.st_mode, modep);
 			(void)fprintf(stderr, "override %s%s%s/%s for %s? %s",
 			    modep + 1, modep[9] == ' ' ? "" : " ",



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201211260513.qAQ5DwZV003048>