1 diff -Nru lynx2-8-5/src/LYUtils.c lynx2-8-5.new/src/LYUtils.c
2 --- lynx2-8-5/src/LYUtils.c Thu Dec 19 01:57:10 2002
3 +++ lynx2-8-5.new/src/LYUtils.c Mon Mar 10 14:32:58 2003
8 + char *config_dir = getenv("CONFIG_DIR");
14 @@ -5149,13 +5151,39 @@
16 * Set up home string and length. - FM
18 - StrAllocCopy(home, Home_Dir());
21 #define NO_HOMEPATH "Error:"
23 #define NO_HOMEPATH "/error"
27 + StrAllocCopy(home, config_dir);
28 + if (!non_empty(config_dir))
30 + * Home_Dir() has a bug if this ever happens. - FM
32 + StrAllocCopy(config_dir, NO_HOMEPATH);
34 + len = fbuffer_size - (strlen(config_dir) + 1);
37 + * Buffer is smaller than or only big enough for the home path.
38 + * Load what fits of the home path and return. This will fail,
39 + * but we need something in the buffer. - FM
41 + LYstrncpy(fbuffer, config_dir, (fbuffer_size - 1));
45 + * Check whether we have a subdirectory path or just a filename. - FM
47 + file2 = (strncmp(file, "./", 2) ? file : file + 2);
48 + sprintf(fbuffer, "%s/%.*s", config_dir, len,
49 + (strncmp(file2, ".", 1) ? file2 : (file2+1)));
51 + StrAllocCopy(home, Home_Dir());
55 * Home_Dir() has a bug if this ever happens. - FM
57 (strncmp(file, "./", 2) ? file : (file + 2)));