[BACK]Return to util.c CVS log [TXT][DIR] Up to [cvs.NetBSD.org] / src / usr.bin / ftp

Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.

Diff for /src/usr.bin/ftp/util.c between version 1.80 and 1.81

version 1.80, 1999/11/09 07:26:50 version 1.81, 1999/11/11 02:53:03
Line 224  setpeer(argc, argv)
Line 224  setpeer(argc, argv)
 "Remember to set tenex mode when transferring binary files from this machine.\n",  "Remember to set tenex mode when transferring binary files from this machine.\n",
                                     ttyout);                                      ttyout);
                 }                  }
                   updateremotepwd();
                 verbose = overbose;                  verbose = overbose;
         }          }
 }  }
Line 251  cleanuppeer()
Line 252  cleanuppeer()
                 anonftp = 0;                  anonftp = 0;
         data = -1;          data = -1;
         epsv4bad = 0;          epsv4bad = 0;
           if (username)
                   free(username);
         if (!proxy)          if (!proxy)
                 macnum = 0;                  macnum = 0;
 }  }
Line 406  ftp_login(host, user, pass)
Line 409  ftp_login(host, user, pass)
                 goto cleanup_ftp_login;                  goto cleanup_ftp_login;
         }          }
         rval = 1;          rval = 1;
           username = xstrdup(user);
         if (proxy)          if (proxy)
                 goto cleanup_ftp_login;                  goto cleanup_ftp_login;
   
Line 658  remotemodtime(file, noisy)
Line 662  remotemodtime(file, noisy)
         return (rtime);          return (rtime);
 }  }
   
   /*
    * update global `remotepwd', which contains the state of the remote cwd
    */
   void
   updateremotepwd()
   {
           int      overbose, ocode, i;
           char    *cp;
   
           overbose = verbose;
           ocode = code;
           if (debug == 0)
                   verbose = -1;
           if (command("PWD") != COMPLETE)
                   goto badremotepwd;
           cp = strchr(reply_string, ' ');
           if (cp == NULL || cp[0] == '\0' || cp[1] != '"')
                   goto badremotepwd;
           cp += 2;
           for (i = 0; *cp && i < sizeof(remotepwd) - 1; i++, cp++) {
                   if (cp[0] == '"') {
                           if (cp[1] == '"')
                                   cp++;
                           else
                                   break;
                   }
                   remotepwd[i] = *cp;
           }
           remotepwd[i] = '\0';
           if (debug)
                   fprintf(ttyout, "got remotepwd as `%s'\n", remotepwd);
           goto cleanupremotepwd;
    badremotepwd:
           remotepwd[0]='\0';
    cleanupremotepwd:
           verbose = overbose;
           code = ocode;
   }
   
 #ifndef NO_PROGRESS  #ifndef NO_PROGRESS
   
 /*  /*

Legend:
Removed from v.1.80  
changed lines
  Added in v.1.81

CVSweb <webmaster@jp.NetBSD.org>