projects
/
mono.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
f412349
)
[eglib] Ensures that home and user name always have a non-null value.
author
Rodrigo Kumpera
<kumpera@gmail.com>
Thu, 11 Jun 2015 20:25:55 +0000
(16:25 -0400)
committer
Rodrigo Kumpera
<kumpera@gmail.com>
Thu, 11 Jun 2015 20:25:55 +0000
(16:25 -0400)
eglib/src/gmisc-unix.c
patch
|
blob
|
history
diff --git
a/eglib/src/gmisc-unix.c
b/eglib/src/gmisc-unix.c
index c7bd3f8e994c3beb2160b7a727e10aa3f84daa0a..273024871c5f890e01410f8a12094cf256cd33d8 100644
(file)
--- a/
eglib/src/gmisc-unix.c
+++ b/
eglib/src/gmisc-unix.c
@@
-104,13
+104,15
@@
get_pw_data (void)
home_dir = g_strdup (pw.pw_dir);
if (user_name == NULL)
user_name = g_strdup (pw.pw_name);
- } else {
- if (user_name == NULL)
- user_name = "somebody";
}
}
#endif
+ if (user_name == NULL)
+ user_name = "somebody";
+ if (home_dir == NULL)
+ home_dir = "/";
+
pthread_mutex_unlock (&pw_lock);
}