home-expand.c revision 2e37d45867d081db150ab78dad303b9077aea24f
/* Copyright (c) 2003-2011 Dovecot authors, see the included COPYING file */
#include "lib.h"
#include "home-expand.h"
#include <stdlib.h>
#include <pwd.h>
int home_try_expand(const char **_path)
{
const char *home, *p;
return 0;
path++;
} else {
if (p == NULL) {
path = "";
} else {
path = p+1;
}
}
return -1;
if (*path == '\0')
else
return 0;
}
const char *home_expand(const char *path)
{
(void)home_try_expand(&path);
return path;
}
{
return path;
return home;
return path;
/* ~/ used */
}