Changeset 3232 in MondoRescue for branches/3.2/mindi-busybox/coreutils/mv.c


Ignore:
Timestamp:
Jan 1, 2014, 12:47:38 AM (10 years ago)
Author:
Bruno Cornec
Message:
  • Update mindi-busybox to 1.21.1
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/3.2/mindi-busybox/coreutils/mv.c

    r2725 r3232  
    2222//usage:#define mv_full_usage "\n\n"
    2323//usage:       "Rename SOURCE to DEST, or move SOURCE(s) to DIRECTORY\n"
    24 //usage:     "\nOptions:"
    2524//usage:     "\n    -f  Don't prompt before overwriting"
    2625//usage:     "\n    -i  Interactive, prompt before overwrite"
     
    3534    "force\0"       No_argument "f"
    3635    "no-clobber\0"  No_argument "n"
     36    "verbose\0"     No_argument "v"
    3737    ;
    3838#endif
    3939
    40 #define OPT_FILEUTILS_FORCE       1
    41 #define OPT_FILEUTILS_INTERACTIVE 2
    42 #define OPT_FILEUTILS_NOCLOBBER   4
     40#define OPT_FORCE       (1 << 0)
     41#define OPT_INTERACTIVE (1 << 1)
     42#define OPT_NOCLOBBER   (1 << 2)
    4343
    4444int mv_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
     
    5858    /* Need at least two arguments.
    5959     * If more than one of -f, -i, -n is specified , only the final one
    60      * takes effect (it unsets previous options). */
     60     * takes effect (it unsets previous options).
     61     * -v is accepted but ignored.
     62     */
    6163    opt_complementary = "-2:f-in:i-fn:n-fi";
    62     flags = getopt32(argv, "fin");
     64    flags = getopt32(argv, "finv");
    6365    argc -= optind;
    6466    argv += optind;
     
    8688 DO_MOVE:
    8789        if (dest_exists) {
    88             if (flags & OPT_FILEUTILS_NOCLOBBER)
     90            if (flags & OPT_NOCLOBBER)
    8991                goto RET_0;
    90             if (!(flags & OPT_FILEUTILS_FORCE)
     92            if (!(flags & OPT_FORCE)
    9193             && ((access(dest, W_OK) < 0 && isatty(0))
    92                 || (flags & OPT_FILEUTILS_INTERACTIVE))
     94                || (flags & OPT_INTERACTIVE))
    9395            ) {
    9496                if (fprintf(stderr, "mv: overwrite '%s'? ", dest) < 0) {
Note: See TracChangeset for help on using the changeset viewer.