aboutsummaryrefslogtreecommitdiffstats
path: root/libcontacts_list_contacts.c
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--libcontacts_list_contacts.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/libcontacts_list_contacts.c b/libcontacts_list_contacts.c
index fbf56ee..6879999 100644
--- a/libcontacts_list_contacts.c
+++ b/libcontacts_list_contacts.c
@@ -3,7 +3,7 @@
int
-libcontacts_list_contacts(char ***idsp, const struct passwd *user)
+libcontacts_list_contacts(char ***idsp, const struct passwd *user, int with_me)
{
char *dirnam;
DIR *dir;
@@ -36,10 +36,12 @@ libcontacts_list_contacts(char ***idsp, const struct passwd *user)
goto start;
while ((f = readdir(dir))) {
- if (strchr(f->d_name, '.'))
- continue;
- if (!f->d_name[0] || strchr(f->d_name, '\0')[-1] == '~')
+ if (f->d_name[0] == '.') {
+ if (!with_me || strcmp(f->d_name, ".me"))
+ continue;
+ } else if (!f->d_name[0] || strchr(f->d_name, '\0')[-1] == '~') {
continue;
+ }
if (!((*idsp)[i++] = strdup(f->d_name)))
goto fail;
start: