Codebase list xd / debian/3.23.00-1 alternatives / gethome.cc
debian/3.23.00-1

Tree @debian/3.23.00-1 (Download .tar.gz)

gethome.cc @debian/3.23.00-1raw · history · blame

#include "alternatives.ih"

string Alternatives::getHome() 
{
    string homeDir;

    char *cp = getenv("HOME");              // determine the homedir

    if (!cp)                                // save it
        homeDir = '/';
    else
    {
        homeDir = cp;
        if (*homeDir.rbegin() != '/')
            homeDir += '/';
    }
    // home set with ending /

    imsg << "Home directory: " << homeDir << endl;

    return homeDir;
}