commit - 16c1defa3dbd8a4388da65e96f53cd767dceb2f3
commit + a5ba8a59263e49be566823bbbca05ebee6c79bd2
blob - 0c4f2d79b6b628a15bb8839aeed286bb06136ab1
blob + eecaf26d20168f792e2bd51b1f5328820d81df54
--- src/cmd/faces/facedb.c
+++ src/cmd/faces/facedb.c
if(dom == nil || *dom == 0)
return nil;
- if((file = readfile(unsharp("#9/lib/face/.machinelist"))) == nil)
+ if((file = readfile(unsharp("#9/face/.machinelist"))) == nil)
return dom;
for(p=file; p; p=nextp) {
tryfindpicture_user(char *dom, char *user, int depth)
{
static char buf[200];
- char *p, *q, *nextp, *file, *usr;
- usr = getuser();
+ char *p, *q, *nextp, *file;
+ static char *home;
- sprint(buf, "/usr/%s/lib/face/48x48x%d/.dict", usr, depth);
+ if(home == nil)
+ home = getenv("home");
+ if(home == nil)
+ home = getenv("HOME");
+ if(home == nil)
+ return nil;
+
+ sprint(buf, "%s/lib/face/48x48x%d/.dict", home, depth);
if((file = readfile(buf)) == nil)
return nil;
if(strcmp(buf, p) == 0) {
q += strspn(q, " \t");
- q = buf+snprint(buf, sizeof buf, "/usr/%s/lib/face/48x48x%d/%s", usr, depth, q);
+ q = buf+snprint(buf, sizeof buf, "%s/lib/face/48x48x%d/%s", home, depth, q);
while(q > buf && (q[-1] == ' ' || q[-1] == '\t'))
*--q = 0;
free(file);
static char buf[200];
char *p, *q, *nextp, *file;
- sprint(buf, "#9/lib/face/48x48x%d/.dict", depth);
+ sprint(buf, "#9/face/48x48x%d/.dict", depth);
if((file = readfile(unsharp(buf))) == nil)
return nil;
if(strcmp(buf, p) == 0) {
q += strspn(q, " \t");
- q = buf+snprint(buf, sizeof buf, "#9/lib/face/48x48x%d/%s", depth, q);
+ q = buf+snprint(buf, sizeof buf, "#9/face/48x48x%d/%s", depth, q);
while(q > buf && (q[-1] == ' ' || q[-1] == '\t'))
*--q = 0;
free(file);