DO NOT REPLY TO THIS MESSAGE. INSTEAD, POST ANY RESPONSES TO THE LINK BELOW.
[STR New]
Link: http://www.fltk.org/str.php?L2784
Version: 2.0-current
In src/filename_absolute.cxx, the functions to convert between relative and
absolute paths try to take the current path from the PWD environment
variable and fall back to getcwd if PWD is not set. Unfortunately, the PWD
environment variable may be incorrect for a variety of reasons including:
- A faulty shell;
- A faulty IDE (I was bitten by this issue because Eclipse will launch a
project from its own folder without updating PWD);
- Or more importantly if the application itself calls chdir without
updating PWD...
The attached patch disables the PWD lookup in favour of the call to
getcwd.
Link: http://www.fltk.org/str.php?L2784
Version: 2.0-currentIndex: src/filename_absolute.cxx
===
--- src/filename_absolute.cxx (revision 9038)
+++ src/filename_absolute.cxx (working copy)
@@ -102,8 +102,7 @@
// current directory
if (pwd) prefix = pwd;
else {
- prefix = getenv(PWD);
- if (!prefix) prefix = getcwd(output, length);
+ prefix = getcwd(output, length);
}
prefixlen = strlen(prefix);
}
@@ -144,8 +143,7 @@
}
if (!cwd) {
-cwd = getenv(PWD);
-if (!cwd) cwd = getcwd(to, tolen);
+cwd = getcwd(to, tolen);
}
const char* slash = from;
___
fltk-bugs mailing list
fltk-bugs@easysw.com
http://lists.easysw.com/mailman/listinfo/fltk-bugs