[hackers] [sbase] enmasse: For the special case of 2 args, do not distinguish between dirs and files || sin

From: <git_AT_suckless.org>
Date: Fri, 13 Nov 2015 15:21:11 +0100 (CET)

commit 996f992ac6061e900a1a84d863e83f47868500f8
Author: sin <sin_AT_2f30.org>
AuthorDate: Fri Nov 13 14:18:47 2015 +0000
Commit: sin <sin_AT_2f30.org>
CommitDate: Fri Nov 13 14:21:07 2015 +0000

    enmasse: For the special case of 2 args, do not distinguish between dirs and files
    
    This produces consistent error messages when moving or copying a file or dir to
    itself.

diff --git a/libutil/enmasse.c b/libutil/enmasse.c
index a2e225a..97b4957 100644
--- a/libutil/enmasse.c
+++ b/libutil/enmasse.c
_AT_@ -3,7 +3,6 @@
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
-#include <sys/stat.h>
 #include <unistd.h>
 
 #include "../util.h"
_AT_@ -11,12 +10,11 @@
 void
 enmasse(int argc, char *argv[], int (*fn)(const char *, const char *, int))
 {
- struct stat st;
         char buf[PATH_MAX], *dir;
         int i, len;
         size_t dlen;
 
- if (argc == 2 && !(stat(argv[1], &st) == 0 && S_ISDIR(st.st_mode))) {
+ if (argc == 2) {
                 fnck(argv[0], argv[1], fn, 0);
                 return;
         } else {
Received on Fri Nov 13 2015 - 15:21:11 CET

This archive was generated by hypermail 2.3.0 : Fri Nov 13 2015 - 15:24:12 CET