[BACK]Return to sftp.c CVS log [TXT][DIR] Up to [local] / src / usr.bin / ssh

Diff for /src/usr.bin/ssh/sftp.c between version 1.98 and 1.99

version 1.98, 2007/12/12 05:04:03 version 1.99, 2008/01/20 00:38:30
Line 422 
Line 422 
 }  }
   
 static int  static int
 is_reg(char *path)  
 {  
         struct stat sb;  
   
         if (stat(path, &sb) == -1)  
                 fatal("stat %s: %s", path, strerror(errno));  
   
         return(S_ISREG(sb.st_mode));  
 }  
   
 static int  
 remote_is_dir(struct sftp_conn *conn, char *path)  remote_is_dir(struct sftp_conn *conn, char *path)
 {  {
         Attrib *a;          Attrib *a;
Line 520 
Line 509 
         glob_t g;          glob_t g;
         int err = 0;          int err = 0;
         int i;          int i;
           struct stat sb;
   
         if (dst) {          if (dst) {
                 tmp_dst = xstrdup(dst);                  tmp_dst = xstrdup(dst);
Line 528 
Line 518 
   
         memset(&g, 0, sizeof(g));          memset(&g, 0, sizeof(g));
         debug3("Looking up %s", src);          debug3("Looking up %s", src);
         if (glob(src, 0, NULL, &g)) {          if (glob(src, GLOB_NOCHECK, NULL, &g)) {
                 error("File \"%s\" not found.", src);                  error("File \"%s\" not found.", src);
                 err = -1;                  err = -1;
                 goto out;                  goto out;
Line 543 
Line 533 
         }          }
   
         for (i = 0; g.gl_pathv[i] && !interrupted; i++) {          for (i = 0; g.gl_pathv[i] && !interrupted; i++) {
                 if (!is_reg(g.gl_pathv[i])) {                  if (stat(g.gl_pathv[i], &sb) == -1) {
                           err = -1;
                           error("stat %s: %s", g.gl_pathv[i], strerror(errno));
                           continue;
                   }
   
                   if (!S_ISREG(sb.st_mode)) {
                         error("skipping non-regular file %s",                          error("skipping non-regular file %s",
                             g.gl_pathv[i]);                              g.gl_pathv[i]);
                         continue;                          continue;

Legend:
Removed from v.1.98  
changed lines
  Added in v.1.99