OSDN Git Service

Whitespace and comment.
authorRob Landley <rob@landley.net>
Wed, 30 Mar 2016 08:20:13 +0000 (03:20 -0500)
committerRob Landley <rob@landley.net>
Wed, 30 Mar 2016 08:20:13 +0000 (03:20 -0500)
tests/mv.test
toys/posix/cp.c

index b699d01..036fd48 100755 (executable)
@@ -1,5 +1,10 @@
 #!/bin/bash
 
+# TODO: needs root to mount tmpfs to test moving across filesystems.
+# check handling of chattr +i immutable bit
+# "touch two; chmod -w two; mv one two" shouldn't prompt to delete two if
+#   one doesn't exist.
+
 # Copyright 2013 Robin Mittal <robinmittal.it@gmail.com>
 # Copyright 2013 Divya Kothari <divya.s.kothari@gmail.com>
 
index 8bcb81e..ea1ef6f 100644 (file)
@@ -396,9 +396,11 @@ void cp_main(void)
     errno = EXDEV;
     if (CFG_MV && toys.which->name[0] == 'm') {
       int force = toys.optflags & FLAG_f, no_clobber = toys.optflags & FLAG_n;
+
       if (!force || no_clobber) {
         struct stat st;
         int exists = !stat(TT.destname, &st);
+
         // Prompt if -i or file isn't writable.  Technically "is writable" is
         // more complicated (022 is not writeable by the owner, just everybody
         // _else_) but I don't care.