Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 15 Nov 2012 15:05:51 +0000 (UTC)
From:      Eitan Adler <eadler@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r243072 - head/bin/mv
Message-ID:  <201211151505.qAFF5pVc003659@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: eadler
Date: Thu Nov 15 15:05:51 2012
New Revision: 243072
URL: http://svnweb.freebsd.org/changeset/base/243072

Log:
  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
  Submitted by:	Mark Johnston <markjdb@gmail.com>
  Approved by:	cperciva
  MFC after:	3 days

Modified:
  head/bin/mv/mv.c

Modified: head/bin/mv/mv.c
==============================================================================
--- head/bin/mv/mv.c	Thu Nov 15 15:05:47 2012	(r243071)
+++ head/bin/mv/mv.c	Thu Nov 15 15:05:51 2012	(r243072)
@@ -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] == ' ' ? "" : " ",
_______________________________________________
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscribe@freebsd.org"



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