1 --- lynx2-8-6/src/LYUtils.c.orig 2006-11-07 02:27:15.000000000 +0100
2 +++ lynx2-8-6/src/LYUtils.c 2007-02-25 21:41:54.554627431 +0100
7 + char *etc_dir = getenv("ETC_DIR");
8 const char *file = fname;
13 @@ -5353,13 +5355,39 @@
15 * Set up home string and length. - FM
17 - StrAllocCopy(home, Home_Dir());
20 #define NO_HOMEPATH "Error:"
22 #define NO_HOMEPATH "/error"
26 + StrAllocCopy(home, etc_dir);
27 + if (!non_empty(etc_dir))
29 + * Home_Dir() has a bug if this ever happens. - FM
31 + StrAllocCopy(etc_dir, NO_HOMEPATH);
33 + len = fbuffer_size - (strlen(etc_dir) + 1);
36 + * Buffer is smaller than or only big enough for the home path.
37 + * Load what fits of the home path and return. This will fail,
38 + * but we need something in the buffer. - FM
40 + LYstrncpy(fbuffer, etc_dir, (fbuffer_size - 1));
44 + * Check whether we have a subdirectory path or just a filename. - FM
46 + file2 = (strncmp(file, "./", 2) ? file : file + 2);
47 + sprintf(fbuffer, "%s/%.*s", etc_dir, len,
48 + (strncmp(file2, ".", 1) ? file2 : (file2+1)));
50 + StrAllocCopy(home, Home_Dir());
54 * Home_Dir() has a bug if this ever happens. - FM
56 (StrNCmp(file, "./", 2) ? file : (file + 2)));