source: npl/system/netkit-ftp/patches/32-netkit-ftp-0.17-getlogin.patch

Last change on this file was c5c522c, checked in by Edwin Eefting <edwin@datux.nl>, 8 years ago

initial commit, transferred from cleaned syn3 svn tree

  • Property mode set to 100644
File size: 1.1 KB
  • netkit-ftp-0.

    old new dologin(const char *host) 
    328328                return(0);
    329329        }
    330330        while (luser == NULL) {
    331                 char *myname = getlogin();
     331                char *myname = NULL;
    332332
    333                 if (myname == NULL) {
    334                         struct passwd *pp = getpwuid(getuid());
     333                struct passwd *pp = getpwuid(getuid());
    335334
    336                         if (pp != NULL)
    337                                 myname = pp->pw_name;
    338                 }
     335                if (pp != NULL)
     336                        myname = pp->pw_name;
    339337                if (myname)
    340338                        printf("Name (%s:%s): ", host, myname);
    341339                else
  • netkit-ftp-0.

    old new main(volatile int argc, char **volatile 
    204204        /*
    205205         * Set up the home directory in case we're globbing.
    206206         */
    207         cp = getlogin();
    208         if (cp != NULL) {
    209                 pw = getpwnam(cp);
    210         }
    211         if (pw == NULL)
    212                 pw = getpwuid(getuid());
     207        pw = getpwuid(getuid());
    213208        if (pw != NULL) {
    214209                strncpy(homedir, pw->pw_dir, sizeof(homedir));
    215210                homedir[sizeof(homedir)-1] = 0;
Note: See TracBrowser for help on using the repository browser.