News:

Simutrans Wiki Manual
The official on-line manual for Simutrans. Read and contribute.

mkdir before chdir in pakinstaller

Started by thfr, January 19, 2024, 12:58:19 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

thfr

This diff fixes running the pakinstaller (the menu for downloading paksets on first launch if none are present) on OpenBSD where I'm developing a port of simutrans. Before this patch, running simutrans without a pre-existing directory
~/simutrans/ would fail on first run (not second because the directory exists then). Also fixes the downloading of other/multiple paksets. An alternative approach would be to include mkdir in dr_chdir, and/or error handling for dr_chdir.

Fixes things on OpenBSD, but the solution should apply to *nix (Linux, other BSDs).

prissi