Shandalar - Program Bugs
shandalar.exe looks in CWD for resources (reviewed)
For example, it tries to load cardback.pic from ./cardart/cardback.pic, rather than from $(dirname $0)/cardart/cardback.pic.
On windows this is rarely an issue, since the default value for CWD (both when double-clicking and when creating a shortcut) is the executable's containing directory, so you have work fairly hard to make this a problem. It is, however, very easy to run into when running it on linux via Wine, since the natural approach is to either 'wine C:/.../shandalar.exe' or 'wine ~/.wine/drive_c/.../shandalar.exe', and neither of those will work.
It is at least very easy to work around: cd into the shandalar directory and then start with 'wine ./shandalar.exe'.
On windows this is rarely an issue, since the default value for CWD (both when double-clicking and when creating a shortcut) is the executable's containing directory, so you have work fairly hard to make this a problem. It is, however, very easy to run into when running it on linux via Wine, since the natural approach is to either 'wine C:/.../shandalar.exe' or 'wine ~/.wine/drive_c/.../shandalar.exe', and neither of those will work.
It is at least very easy to work around: cd into the shandalar directory and then start with 'wine ./shandalar.exe'.
Comments
Posted by Korath » 07 Mar 2016, 00:28
commit 9ea02f743ce436047af59fcdc3c2db74c6b25b78
Author: Korath <dgk@Dirge.none>
Date: Sun Mar 6 19:27:02 2016 -0500
[AS] #1018: cd to base dir at start of init_shandalar()
Shandalar.exe cds to the dirname of its executable no less than three times.
None are in time for the initialization Shandalar.dll does, and the second time
is done quite dangerously by fetching the OS mirror of argv[0] and editing it
in-place to remove the executable basename. (This shouldn't work at all ever;
it tends to cause crashes while running from a vanilla Windows command prompt,
as reported at <http://www.slightlymagic.net/forum/viewtopic.php?t=18355>.)
This still isn't in time for Drawcardlib.dll or likely CardArtlib.dll; they'll
have to both redundant cd there themselves as well.
Author: Korath <dgk@Dirge.none>
Date: Sun Mar 6 19:27:02 2016 -0500
[AS] #1018: cd to base dir at start of init_shandalar()
Shandalar.exe cds to the dirname of its executable no less than three times.
None are in time for the initialization Shandalar.dll does, and the second time
is done quite dangerously by fetching the OS mirror of argv[0] and editing it
in-place to remove the executable basename. (This shouldn't work at all ever;
it tends to cause crashes while running from a vanilla Windows command prompt,
as reported at <http://www.slightlymagic.net/forum/viewtopic.php?t=18355>.)
This still isn't in time for Drawcardlib.dll or likely CardArtlib.dll; they'll
have to both redundant cd there themselves as well.
2 Posts
• Page 1 of 1
Ticket details
- Ticket ID: 1018
- Project: Shandalar
- Status: Reviewed
- Component: Adventure Mode
- Project version: Thieves Hideout 3
- Priority: Normal
- Severity: Normal
- Assigned to: (unassigned)
- Reported by: ToxicFrog
- Reporter's tickets: List all tickets
- Reported on: 19 Feb 2016, 23:01
- Last visited by Korath » 16 Mar 2016, 16:38.