Browse Source

use std::string, fixed indentation

git-svn-id: svn+ssh://svn.berlios.de/svnroot/repos/slim/trunk@102 7c53e7cc-98ea-0310-8f1f-a0b24da60408
sip 17 years ago
parent
commit
d214776d3a
1 changed files with 6 additions and 5 deletions
  1. 6 5
      switchuser.cpp

+ 6 - 5
switchuser.cpp

@@ -103,9 +103,10 @@ char* SwitchUser::StrConcat(const char* str1, const char* str2) {
 }
 
 void SwitchUser::SetClientAuth(const char* mcookie) {
-        int r;
-        string authfile = StrConcat(Pw->pw_dir,"/.Xauthority");
-        remove(authfile.c_str());
-        string cmd = cfg->getOption("xauth_path") + " -q -f " + authfile + " add :0 . " + mcookie;
-        r = system(cmd.c_str());
+    int r;
+    string home = string(Pw->pw_dir);
+    string authfile = home + "/.Xauthority";
+    remove(authfile.c_str());
+    string cmd = cfg->getOption("xauth_path") + " -q -f " + authfile + " add :0 . " + mcookie;
+    r = system(cmd.c_str());
 }