This commit is contained in:
parent
9f52824611
commit
26c54bb7d9
@ -257,19 +257,25 @@ extern "C"
|
||||
|
||||
char * GetDefaultWallet()
|
||||
{
|
||||
char *homedir = getenv("HOME");;
|
||||
char *homedir = NULL;
|
||||
char *defaultwallet = NULL;
|
||||
defaultwallet = (char *)malloc(MAX_LENGTH);
|
||||
FILE *fs;
|
||||
char str[MAX_LENGTH];
|
||||
char *str1 = "Default Wallet=";
|
||||
char str[MAX_LENGTH];
|
||||
FILE *fs = NULL;
|
||||
int i,j,k;
|
||||
//cout<<"kwallets_rw.cpp : Home Directory =" << homedir;
|
||||
|
||||
defaultwallet = (char *)malloc(MAX_LENGTH);
|
||||
homedir = (char *)malloc(MAX_LENGTH);
|
||||
|
||||
strcpy(homedir, getenv("HOME"));
|
||||
strcat(homedir, "/.kde/share/config/kwalletrc");
|
||||
//cout << "\nkwallets_rw.cpp : Home directory full path = " << homedir;
|
||||
strcat(homedir,"\0");
|
||||
|
||||
fs = fopen(homedir,"r");
|
||||
if(!fs)
|
||||
if(fs == NULL)
|
||||
{
|
||||
free (homedir);
|
||||
free (defaultwallet);
|
||||
return "kdewallet";
|
||||
}
|
||||
while(!feof(fs))
|
||||
@ -287,11 +293,13 @@ extern "C"
|
||||
for(j=i,k=0;j<strlen(str);j++,k++)
|
||||
defaultwallet[k] = str[j];
|
||||
defaultwallet[k-1] = '\0';
|
||||
free(homedir);
|
||||
return defaultwallet;
|
||||
}
|
||||
else
|
||||
continue;
|
||||
}
|
||||
free(homedir);
|
||||
return "kdewallet";
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user