[ wxwindows-Bugs-1550344 ] environment variable expansion
SourceForge.net
noreply at sourceforge.net
Fri Sep 1 00:21:56 PDT 2006
Bugs item #1550344, was opened at 2006-09-01 07:21
Message generated for change (Tracker Item Submitted) made by Item Submitter
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=109863&aid=1550344&group_id=9863
Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: Common
Group: None
Status: Open
Resolution: None
Priority: 5
Submitted By: MrLeviathan (mrleviathan)
Assigned to: Nobody/Anonymous (nobody)
Summary: environment variable expansion
Initial Comment:
Hello!
The problem is following. I am using Doc/View with
wxFileHistory. My actual path for document is
"D:\Documents\$space\spice\Data\ssd\5.xml"
and the path is correctly saved by the
wxDocManager::FileHistorySave() function to config.
However, when the MRU files list is loaded by a
FileHistoryLoad call, returned string for this
document turns into
"D:\Documents$space\spice\Data\ssd\5.xml"
(notice missing backslash after the
directory "Documents" before '$').
It is because of extra expansion of environment
variables which is applied inside the function
wxConfigBase::Read. At its end, it calls global
function 'wxExpandEnvVars' (config.cpp), which, when
it finds backslash, jumps over this backslash in a
good faith, because "backslash can be used to
suppress special meaning of % and $" (comment from
source code itself). However, no variable is found
then.
Probably, there should be a test if the following
string is really a valid environment variable or not
(e.g. set some flag when '\\' is detected, and in
next step, which tests possible environment variable
for presence, add back missing '\\' when no such
variable is found).
Later: I have found that this translation is used
also in other classes, at least in wxFileName class,
so this is the overall problem.
With nice greetings,
Jakub Schwarzmeier
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=109863&aid=1550344&group_id=9863
More information about the wx-dev
mailing list