blob: 588997f63cb68f323b9130d7f0291f9cc247bd29 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
|
--- aspell-0.60.7-20110707/common/config.cpp.orig 2014-03-20 19:51:08.756753700 +0000
+++ aspell-0.60.7-20110707/common/config.cpp 2014-03-20 20:15:54.984480600 +0000
@@ -664,6 +664,21 @@
} else { // sep == '|'
assert(replace[0] == '$');
const char * env = getenv(replace.c_str()+1);
+ if (NULL == env && strcmp (replace.c_str() + 1, "HOME") == 0)
+ {
+ const char *hd, *hp;
+ hd = getenv("HOMEDRIVE");
+ hp = getenv("HOMEPATH");
+ if (hd && hp)
+ {
+ char tmpbuf[strlen ("HOME=") + strlen (hd) + strlen (hp) + 1];
+ strcpy (tmpbuf, "HOME=");
+ strcpy (&tmpbuf[strlen ("HOME=")], hd);
+ strcpy (&tmpbuf[strlen ("HOME=") + strlen (hd)], hp);
+ putenv (tmpbuf);
+ env = getenv(replace.c_str()+1);
+ }
+ }
final_str += env ? env : second;
}
replace = "";
|