comparison mcabber/src/utils.c @ 1222:75aee46d3aee

Fix a problem with the ssl_ca{file,path} variables expansion
author Mikael Berthe <mikael@lilotux.net>
date Thu, 17 May 2007 10:44:01 +0200
parents 2de8f8ba1f34
children 3a4018f18bdf
comparison
equal deleted inserted replaced
1221:0dd5df7eb007 1222:75aee46d3aee
48 // expand_filename(filename) 48 // expand_filename(filename)
49 // Expand "~/" with the $HOME env. variable in a file name. 49 // Expand "~/" with the $HOME env. variable in a file name.
50 // The caller must free the string after use. 50 // The caller must free the string after use.
51 char *expand_filename(const char *fname) 51 char *expand_filename(const char *fname)
52 { 52 {
53 if (!fname)
54 return NULL;
53 if (!strncmp(fname, "~/", 2)) { 55 if (!strncmp(fname, "~/", 2)) {
54 char *homedir = getenv("HOME"); 56 char *homedir = getenv("HOME");
55 if (homedir) 57 if (homedir)
56 return g_strdup_printf("%s%s", homedir, fname+1); 58 return g_strdup_printf("%s%s", homedir, fname+1);
57 } 59 }