Message17999
Logged In: YES
user_id=341410
After doing some more playing around, I discovered a few
other examples that would kill either method described below:
HOME=%USERDRIVE%%USERPATH%
HOME=C:\%userprofiles\%USERNAME%
The real trick is that % can exist in a path on windows, so
even c:\%HOME% is a vaild path:
Directory of D:\test
03/26/2004 03:58p <DIR> .
03/26/2004 03:58p <DIR> ..
03/26/2004 03:59p <DIR> %HOME%
0 File(s) 0 bytes
3 Dir(s) 5,355,511,808 bytes free
D:\test>
I suppose the question remains as to what cases do we want
to cover. If we assume that there aren't any % symbols in a
path, then the code is straightforward, and I can have a
patch for you in a few minutes. If % can be in a path, then
the problem is a pain, and a miniature parser needs to be
written to deal with it. |
|
Date |
User |
Action |
Args |
2007-08-23 14:16:32 | admin | link | issue796219 messages |
2007-08-23 14:16:32 | admin | create | |
|