formatting changes
authorAndrew Tridgell <tridge@samba.org>
Tue, 26 May 1998 14:17:27 +0000 (14:17 +0000)
committerAndrew Tridgell <tridge@samba.org>
Tue, 26 May 1998 14:17:27 +0000 (14:17 +0000)
main.c

diff --git a/main.c b/main.c
index 67ece95..4cf4cf6 100644 (file)
--- a/main.c
+++ b/main.c
@@ -148,40 +148,41 @@ static char *get_local_name(struct file_list *flist,char *name)
        STRUCT_STAT st;
        extern int orig_umask;
 
-  if (do_stat(name,&st) == 0) {
-    if (S_ISDIR(st.st_mode)) {
-      if (chdir(name) != 0) {
-       rprintf(FERROR,"chdir %s : %s (1)\n",name,strerror(errno));
-       exit_cleanup(1);
-      }
-      return NULL;
-    }
-    if (flist->count > 1) {
-      rprintf(FERROR,"ERROR: destination must be a directory when copying more than 1 file\n");
-      exit_cleanup(1);
-    }
-    return name;
-  }
-
-  if (flist->count == 1)
-    return name;
-
-  if (!name) 
-    return NULL;
-
-  if (do_mkdir(name,0777 & ~orig_umask) != 0) {
-    rprintf(FERROR,"mkdir %s : %s (1)\n",name,strerror(errno));
-    exit_cleanup(1);
-  } else {
-    rprintf(FINFO,"created directory %s\n",name);
-  }
-
-  if (chdir(name) != 0) {
-    rprintf(FERROR,"chdir %s : %s (2)\n",name,strerror(errno));
-    exit_cleanup(1);
-  }
-
-  return NULL;
+       if (do_stat(name,&st) == 0) {
+               if (S_ISDIR(st.st_mode)) {
+                       if (chdir(name) != 0) {
+                               rprintf(FERROR,"chdir %s : %s (1)\n",
+                                       name,strerror(errno));
+                               exit_cleanup(1);
+                       }
+                       return NULL;
+               }
+               if (flist->count > 1) {
+                       rprintf(FERROR,"ERROR: destination must be a directory when copying more than 1 file\n");
+                       exit_cleanup(1);
+               }
+               return name;
+       }
+
+       if (flist->count == 1)
+               return name;
+
+       if (!name) 
+               return NULL;
+
+       if (do_mkdir(name,0777 & ~orig_umask) != 0) {
+               rprintf(FERROR,"mkdir %s : %s (1)\n",name,strerror(errno));
+               exit_cleanup(1);
+       } else {
+               rprintf(FINFO,"created directory %s\n",name);
+       }
+
+       if (chdir(name) != 0) {
+               rprintf(FERROR,"chdir %s : %s (2)\n",name,strerror(errno));
+               exit_cleanup(1);
+       }
+
+       return NULL;
 }