1 diff -ruN lftp-2.5.2.org/src/bookmark.cc lftp-2.5.2/src/bookmark.cc
2 --- lftp-2.5.2.org/src/bookmark.cc Mon Jan 21 17:25:16 2002
3 +++ lftp-2.5.2/src/bookmark.cc Mon Jun 3 10:38:02 2002
5 const char *home=getenv("HOME");
8 - const char *add="/.lftp/bookmarks";
9 - bm_file=xstrdup(home,+strlen(add));
10 - strcat(bm_file,add);
11 + if (getenv("CONFIG_DIR")) {
12 + const char *add="/lftp/bookmarks";
13 + bm_file=xstrdup(home,+strlen(add)+strlen(getenv("CONFIG_DIR"))+1);
14 + sprintf(bm_file,"%s/%s%s", home, getenv("CONFIG_DIR"), add);
17 + const char *add="/.lftp/bookmarks";
18 + bm_file=xstrdup(home,+strlen(add));
19 + strcat(bm_file,add);
24 diff -ruN lftp-2.5.2.org/src/commands.cc lftp-2.5.2/src/commands.cc
25 --- lftp-2.5.2.org/src/commands.cc Sun May 5 16:22:55 2002
26 +++ lftp-2.5.2/src/commands.cc Mon Jun 3 10:38:02 2002
27 @@ -2451,7 +2451,10 @@
29 else if(!strcasecmp(op,"edit"))
31 - parent->PrependCmd("shell \"/bin/sh -c 'exec ${EDITOR:-vi} $HOME/.lftp/bookmarks'\"\n");
32 + if (getenv("CONFIG_DIR"))
33 + parent->PrependCmd("shell \"/bin/sh -c 'exec ${EDITOR:-vi} $HOME/$CONFIG_DIR/lftp/bookmarks'\"\n");
35 + parent->PrependCmd("shell \"/bin/sh -c 'exec ${EDITOR:-vi} $HOME/.lftp/bookmarks'\"\n");
37 else if(!strcasecmp(op,"import"))
39 diff -ruN lftp-2.5.2.org/src/history.cc lftp-2.5.2/src/history.cc
40 --- lftp-2.5.2.org/src/history.cc Mon Jan 21 17:25:17 2002
41 +++ lftp-2.5.2/src/history.cc Mon Jun 3 10:38:02 2002
43 const char *home=getenv("HOME");
46 - const char *add="/.lftp/cwd_history";
47 - file=xstrdup(home,+strlen(add));
49 + if (getenv("CONFIG_DIR")) {
50 + const char *add="/lftp/cwd_history";
51 + file=xstrdup(home,+strlen(add)+strlen(getenv("CONFIG_DIR"))+1);
52 + sprintf(file,"%s/%s%s", home, getenv("CONFIG_DIR"), add);
55 + const char *add="/.lftp/cwd_history";
56 + file=xstrdup(home,+strlen(add));
62 diff -ruN lftp-2.5.2.org/src/lftp.cc lftp-2.5.2/src/lftp.cc
63 --- lftp-2.5.2.org/src/lftp.cc Wed Feb 27 10:15:57 2002
64 +++ lftp-2.5.2/src/lftp.cc Mon Jun 3 10:39:57 2002
66 const char *home=getenv("HOME");
69 - char *log=(char*)alloca(strlen(home)+1+9+1);
70 - sprintf(log,"%s/.lftp",home);
72 + if (getenv("CONFIG_DIR")) {
73 + log=(char*)alloca(strlen(home)+strlen(getenv("CONFIG_DIR"))+1+9+1);
74 + sprintf(log,"%s/%s/lftp",home,getenv("CONFIG_DIR"));
77 + log=(char*)alloca(strlen(home)+1+9+1);
78 + sprintf(log,"%s/.lftp",home);
80 if(access(log,F_OK)==-1)
84 const char *home=getenv("HOME");
87 - char *rc=(char*)alloca(strlen(home)+9+1);
88 + // create lftp own directory
89 + if (getenv("CONFIG_DIR")) {
90 + char *rc=(char*)alloca(strlen(home)+strlen(getenv("CONFIG_DIR"))+9+1);
91 + sprintf(rc,"%s/%s/lftp",home,getenv("CONFIG_DIR"));
94 - // create lftp own directory
95 + sprintf(rc,"%s/%s/lftprc",home,getenv("CONFIG_DIR"));
96 + source_if_exist(top_exec,rc);
97 + sprintf(rc,"%s/%s/lftp/rc",home,getenv("CONFIG_DIR"));
98 + source_if_exist(top_exec,rc);
101 + char *rc=(char*)alloca(strlen(home)+9+1);
102 sprintf(rc,"%s/.lftp",home);
106 source_if_exist(top_exec,rc);
107 sprintf(rc,"%s/.lftp/rc",home);
108 source_if_exist(top_exec,rc);